X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fcpu8051.c;h=55e761a75e4a4c431b23d406df6c9ff4218bb22e;hb=98b757f83d9e4be02e9373f3279d432d3f7113f5;hp=58a0e792a11d07fea80512e47907a75f69e2ffe1;hpb=21fb2cf2a3c16d19ec65a3afacdcb15a90a38340;p=emu8051.git diff --git a/src/cpu8051.c b/src/cpu8051.c index 58a0e79..55e761a 100644 --- a/src/cpu8051.c +++ b/src/cpu8051.c @@ -28,6 +28,7 @@ #include "reg8051.h" #include "cpu8051.h" #include "memory.h" +#include "psw.h" #include "disasm.h" #include "instructions_8051.h" @@ -374,6 +375,12 @@ cpu8051_Exec(void) cpu8051.pc++; insttiming = (*opcode_table[opcode])(); /* Function callback. */ + /* + * Parity bit (p): is automatically set or cleared in each machine + * cycle to establish even parity in the accumulator. + */ + psw_compute_parity_bit(); + for (i = 0; i < insttiming; i++) { cpu8051_CheckInterrupts(); cpu8051_DoTimers();