projects
/
emu8051.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add parity bit update each instruction cycle
[emu8051.git]
/
src
/
cpu8051.c
diff --git
a/src/cpu8051.c
b/src/cpu8051.c
index
58a0e79
..
55e761a
100644
(file)
--- a/
src/cpu8051.c
+++ b/
src/cpu8051.c
@@
-28,6
+28,7
@@
#include "reg8051.h"
#include "cpu8051.h"
#include "memory.h"
#include "reg8051.h"
#include "cpu8051.h"
#include "memory.h"
+#include "psw.h"
#include "disasm.h"
#include "instructions_8051.h"
#include "disasm.h"
#include "instructions_8051.h"
@@
-374,6
+375,12
@@
cpu8051_Exec(void)
cpu8051.pc++;
insttiming = (*opcode_table[opcode])(); /* Function callback. */
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();
for (i = 0; i < insttiming; i++) {
cpu8051_CheckInterrupts();
cpu8051_DoTimers();