summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:39:45 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:39:45 -0400
commita6d2e3be40108ab9aa6b0a896117902f84bdb926 (patch)
treec4227e13123580ff3c4adbc72631aa8ef99a52b8
parent375c099d1f35f092ca807feffea7dd5c632382f2 (diff)
sux.h: Add bitmasks for conditional branches.
-rw-r--r--sux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sux.h b/sux.h
index a2a509e..fd313c5 100644
--- a/sux.h
+++ b/sux.h
@@ -1840,6 +1840,9 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
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. */ \
+ /* Conditional branches. */ \
+ t(0, 0x00010000, 0x00010000, 0x00010000, 0x00010001, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { if (tmp) { cpu->pc = addr; } } /* Flag is 1. */ \
+ t(0, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { if (!tmp) { cpu->pc = addr; } } /* Flag is 0. */ \
}
#undef ORTHO_1CC