public override void Execute(PICController controller) { PICWatchDogTimer wdt = controller.GetWatchDog(); wdt.Reset(); if (controller.GetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PSA)) { controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS0, false); controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS1, false); controller.SetUnbankedRegisterBit(PICMemory.ADDR_OPTION, PICMemory.OPTION_BIT_PS2, false); } controller.SetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_TO, true); controller.SetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_PD, true); }
public override void Execute(PICController controller) { uint Result = controller.GetBankedRegister(Register); uint Carry_Old = controller.GetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_C) ? 1u : 0u; uint Carry_New = (Result & 0x80) >> 7; Result = Result << 1; Result &= 0xFF; Result |= Carry_Old; controller.SetUnbankedRegisterBit(PICMemory.ADDR_STATUS, PICMemory.STATUS_BIT_C, Carry_New != 0); if (Target) { controller.SetBankedRegister(Register, Result); } else { controller.SetWRegister(Result); } }