[X] Testprogramm 8 (Interrupts)

This commit is contained in:
Mike Schwörer 2017-05-16 18:08:39 +02:00
parent 8dc2517509
commit e064604cf0
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 24 additions and 14 deletions

View File

@ -35,6 +35,7 @@ namespace PIC_Simulator
lvSpecial.Items.Add(new ListViewItem(new[] { "PC", "0x00" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Status", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Option", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Intcon", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "Time", "0ms" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "RA (Backing)", "0b00000000" }));
lvSpecial.Items.Add(new ListViewItem(new[] { "RB (Backing)", "0b00000000" }));
@ -200,13 +201,14 @@ namespace PIC_Simulator
lvSpecial.Items[1].SubItems[1].Text = string.Format("{0,4}", programm.PCCounter);
lvSpecial.Items[2].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS), 2).PadLeft(8, '0'));
lvSpecial.Items[3].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_OPTION), 2).PadLeft(8, '0'));
lvSpecial.Items[4].SubItems[1].Text = string.Format("{0}ms", programm.Stepcount * int.Parse(insertTime.Text));
lvSpecial.Items[5].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_A], 2).PadLeft(8, '0');
lvSpecial.Items[6].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_B], 2).PadLeft(8, '0');
lvSpecial.Items[7].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_C) ? "1" : "0";
lvSpecial.Items[8].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_DC) ? "1" : "0";
lvSpecial.Items[9].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_Z) ? "1" : "0";
lvSpecial.Items[10].SubItems[1].Text = string.Format("{0:0.000}ms", programm.WatchDog.time * 1000);
lvSpecial.Items[4].SubItems[1].Text = string.Format("0b{0}", Convert.ToString(programm.GetRegisterOhneBank(PICProgramm.ADDR_INTCON), 2).PadLeft(8, '0'));
lvSpecial.Items[5].SubItems[1].Text = string.Format("{0}ms", programm.Stepcount * int.Parse(insertTime.Text));
lvSpecial.Items[6].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_A], 2).PadLeft(8, '0');
lvSpecial.Items[7].SubItems[1].Text = "0b" + Convert.ToString(programm.Register[PICProgramm.ADDR_PORT_B], 2).PadLeft(8, '0');
lvSpecial.Items[8].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_C) ? "1" : "0";
lvSpecial.Items[9].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_DC) ? "1" : "0";
lvSpecial.Items[10].SubItems[1].Text = programm.GetRegisterOhneBank(PICProgramm.ADDR_STATUS, PICProgramm.STATUS_BIT_Z) ? "1" : "0";
lvSpecial.Items[11].SubItems[1].Text = string.Format("{0:0.000}ms", programm.WatchDog.time * 1000);
lbStack.Items.Clear();
foreach (var u in programm.Stack) lbStack.Items.Add(u.ToString());

View File

@ -132,6 +132,8 @@ namespace PIC_Simulator.PIC
public PICTimer Zaehler;
public PICWatchDog WatchDog;
public byte Merker_RB0;
public PICProgramm(Form1 f)
{
Zaehler = new PICTimer(this);
@ -812,6 +814,12 @@ namespace PIC_Simulator.PIC
WatchDog.Aktualisieren(cycleCount);
if (Merker_RB0 != Register[ADDR_PORT_B])
{
Interrupt_RB(Merker_RB0, Register[ADDR_PORT_B]);
Merker_RB0 = Register[ADDR_PORT_B];
}
return PCCounter >= befehle.Count;
}

View File

@ -8,7 +8,7 @@
[/] Variablenbezeichner / Variablennamen
[X] INIT-Werte bei RESET
[X] Laufzeitzähler
[?] Latchfunktion der IO-Register
[X] Latchfunktion der IO-Register
[X] frei wählbare Quarzfrequenz
[X] Breakpoints
[X] Hardwareansteuerung
@ -20,7 +20,7 @@
[X] Testprogramm 6 (indirekte Adressierung)
[X] Testprogramm 7 (Timer 0 )
[X] Ext. Taktgeber an RA4 + IO-Pin
[ ] Testprogramm 7 (Interrupts)
[X] Testprogramm 8 (Interrupts)
[X] Testprogramm 9 (Sleep-Befehl)
[X] Testprogramm 10 (PCL und PCLATH)
[X] Testprogramm 11 (Watchdog, Vorteiler)