summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:44:11 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:44:11 -0400
commita1cdb3e59112eaa11b8639c8ab7ed3f1ef088515 (patch)
treefbbd1698a99efd877d7039f02faec6249f5afc2d
parenta6d2e3be40108ab9aa6b0a896117902f84bdb926 (diff)
sux.h: Add bitmask for relative addressing.
-rw-r--r--sux.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sux.h b/sux.h
index fd313c5..1358192 100644
--- a/sux.h
+++ b/sux.h
@@ -1809,6 +1809,7 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(0, 0x01000000, 0x01000000, 0x04000400, 0x00000000, 0x00000000, 0x40000000, 0x40000000, 0x00000000) { pre_idx = 1; } /* Set pre-index flag, for indexed indirect. */ \
t(0, 0x07101210, 0x17101410, 0x14001400, 0x10001000, 0x10000000, 0x40000000, 0x40000000, 0x00000000) { addr = ind_idx_addr(cpu, prefix, inc_clk, ZM, inc_pc, idx, pre_idx); } /* Indirect addressing, with indexing. */ \
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 */ \