summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-19 15:54:23 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-19 15:54:23 -0400
commitee6b0d373c479e7ba8c32863c32f0cf39d1a4c5b (patch)
tree69e028505692a55b2c7711afa9a47f73a3cc4638
parent02fa018869eca949b0fa3c70b05fa96a1be62e70 (diff)
sux.h: Add bitmasks for stack related operations.
-rw-r--r--sux.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sux.h b/sux.h
index 1efae9d..adbb5a8 100644
--- a/sux.h
+++ b/sux.h
@@ -1824,6 +1824,12 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(0, 0x00000000, 0x00000000, 0x02000000, 0x02100110, 0x02000000, 0x00000000, 0x00000000, 0x00000000) { --tmp; } /* dec */ \
/* Store modified value into memory. */ \
t(0, 0x00100000, 0x04101400, 0x00100100, 0x10100100, 0x01001000, 0x51005000, 0x51005000, 0x01001000) { write_value(cpu, tmp, addr, rs, inc_clk, 1); } \
+ /* Stack related operations, and unconditional jumps. */ \
+ t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40004200, 0x00000000, 0x00000000, 0x00000000) { rs = 0; } /* php, plp, and interrupts. */ \
+ t(0, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x40000001, 0x00000000, 0x00000000, 0x00000000) { *reg = pull(cpu, rs, thread); } /* Pull value off the stack. */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00000000, 0x00000000) { cpu->pc = pull(cpu, (rs) ? rs : 7, thread); } /* Pull return address off the stack. */ \
+i t(7, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000200, 0x00000001, 0x00010000, 0x00000000) { push(cpu, cpu->pc, (rs) ? rs : 7, thread); } /* Push return address onto the stack. */ \
+ t(7, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004200, 0x00000000, 0x00000000, 0x00000000) { push(cpu, *reg, rs, thread); } /* Push value onto the stack. */ \
}
#undef ORTHO_1CC