summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-24 15:58:17 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-24 15:58:17 -0400
commit9ff717ec7870826a57ee5266c9d8b534f9fb2398 (patch)
tree3169650c664a903381026fc4a15db8d166556b8e
parent101a518db2c0d57ece4fe95269917b2c0c1ca2e7 (diff)
sux.h: Correct typos in bitmasks for register
assignments, and for inverting `tmp`.
-rw-r--r--sux.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/sux.h b/sux.h
index e042569..d161dc3 100644
--- a/sux.h
+++ b/sux.h
@@ -1811,11 +1811,11 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(7, 0x07561370, 0x17561570, 0x14161560, 0x10161160, 0x11161360, 0x51165161, 0x51175161, 0x01171160) { idx = 0; } /* Reset index. */ \
t(0, 0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { addr = rel_addr(cpu, prefix, inc_clk, inc_pc); } /* Relative addressing (used by conditonal branches). */ \
/* Load Source. */ \
- t(0, 0x02220022, 0x03760576, 0x00320522, 0x00761166, 0x00660066, 0x00660066, 0x51665066, 0x00660066) { reg = &cpu->a; } /* Most operations use the accumulator as an operand */ \
- t(0, 0x05540354, 0x04000000, 0x04000200, 0x02000000, 0x10000000, 0x51005000, 0x00000000, 0x04100110) { reg = &cpu->b; } /* ldb, stb, cpb, inb, deb, tba */ \
- t(0, 0x00000000, 0x00001200, 0x12000000, 0x00001000, 0x05101110, 0x04000000, 0x00100110, 0x00000000) { reg = &cpu->x; } /* ldx, stx, cpx, inx, dex, txa, txy */ \
- t(0, 0x00000000, 0x00000000, 0x00041044, 0x10001200, 0x02000400, 0x00100110, 0x04000000, 0x01001000) { reg = &cpu->y; } /* ldy, sty, cpy, iny, dey, tya, tyx */ \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { reg = &cpu->sp; } /* tsx */ \
+ t(0, 0x02220022, 0x03760576, 0x00220432, 0x00661076, 0x00660066, 0x04660066, 0x55665066, 0x04660066) { reg = &cpu->a; } /* Most operations use the accumulator as an operand */ \
+ t(0, 0x05540354, 0x04000000, 0x04000200, 0x02000000, 0x10000000, 0x51005000, 0x00000000, 0x00100510) { reg = &cpu->b; } /* ldb, stb, cpb, inb, deb, tab */ \
+ t(0, 0x00000000, 0x00001200, 0x12000000, 0x00001400, 0x01101510, 0x00000400, 0x00100110, 0x00000000) { reg = &cpu->x; } /* ldx, stx, cpx, inx, dex, tax, tyx, tsx */ \
+ t(0, 0x00000000, 0x00000000, 0x00041044, 0x10001200, 0x06000000, 0x00100110, 0x00000400, 0x01001000) { reg = &cpu->y; } /* ldy, sty, cpy, iny, dey, tay, txy */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { reg = &cpu->sp; } /* txs */ \
t(7, 0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00014200, 0x00000200, 0x02000200, 0x02000201) { reg = &cpu->ps[thread]; } /* php, test/set/clear flags, and interrupts. */ \
t(0, 0x07561370, 0x17561570, 0x14161560, 0x10161160, 0x11161160, 0x51165161, 0x51175161, 0x01171160) { tmp = read_value(cpu, 0, addr, rs, inc_clk, 1); } /* Read data from memory. */ \
t(0, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000016, 0x00000016, 0x00000016, 0x00000016) { tmp = read_value(cpu, 0, cpu->pc, rs, inc_clk, 0); cpu->pc += rs; } /* Immediate data. */ \
@@ -1836,7 +1836,7 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(0, 0x00000000, 0x00000001, 0x00010000, 0x00000001, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 1; } \
t(7, 0x00000001, 0x00010000, 0x00000000, 0x00000001, 0x00010200, 0x00000200, 0x02000200, 0x00000000) { tmp <<= 2; } \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 4; } \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00220222, 0x00000200) { tmp = ~tmp; } /* sbc, and clear flag. */ \
+ t(0, 0x06000000, 0x00000000, 0x04000400, 0x00441044, 0x10000000, 0x00100310, 0x00320332, 0x00100310) { tmp = ~tmp; } /* sbc, cmp, and clear flag. */ \
t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220222, 0x00000000, 0x02000000, 0x02000000) { tmp |= *reg; } /* ora, and set flag. */ \
t(0, 0x00000001, 0x00010001, 0x00010001, 0x00010001, 0x00010000, 0x00220222, 0x00000200, 0x00000200) { tmp &= *reg; } /* AND, and clear/test flag. */ \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00220022, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp ^= *reg; } /* xor. */ \