SLEEP command

master
Mike Schwörer 6 years ago
parent 7cb924f580
commit 23ecfdd906
  1. 15
      PIC_Simulator/PIC/PICProgramm.cs
  2. BIN
      Projektinformationen/PIC16C84 - Datenblatt - Full.pdf

@ -114,6 +114,7 @@ namespace PIC_Simulator.PIC
public uint Register_W = 0;
public uint[] Register = new uint[0x100];
public Stack<uint> Stack = new Stack<uint>();
public bool IsSleeping = false;
public List<int> Breakpoints = new List<int>();
@ -203,6 +204,8 @@ namespace PIC_Simulator.PIC
PICBefehl aktueller_befehl = befehle[PCCounter];
if (IsSleeping) return false;
if (aktueller_befehl.befehl == ADDWF)
{
// Add the contents of the W register with
@ -697,7 +700,17 @@ namespace PIC_Simulator.PIC
// mode with the oscillator stopped. See
// Section 14.8 for more details.
//TODO
if (GetRegisterOhneBank(ADDR_OPTION, OPTION_BIT_PSA))
{
SetRegisterOhneBank(ADDR_OPTION, OPTION_BIT_PS0, false);
SetRegisterOhneBank(ADDR_OPTION, OPTION_BIT_PS1, false);
SetRegisterOhneBank(ADDR_OPTION, OPTION_BIT_PS2, false);
}
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_TO, true);
SetRegisterOhneBank(ADDR_STATUS, STATUS_BIT_PD, false);
IsSleeping = true;
}
else if (aktueller_befehl.befehl == SUBLW)
{

Loading…
Cancel
Save