summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-21 13:13:07 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-21 13:13:07 -0400
commitbec5270f1c6b8cc629eb60588d2badd69d24ec13 (patch)
tree9a76081f399cdd1611fee05e00203727f59cae56 /sux.h
parent7db02ebda036a8a24df0c17f071c95da33325434 (diff)
sux.h: Add bitmasks for setting/testing/clearing flags,
and for bitwise operations.
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sux.h b/sux.h
index 1eaaffe..4e49f5f 100644
--- a/sux.h
+++ b/sux.h
@@ -1831,6 +1831,15 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
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, 0x00001000, 0x10000000, 0x00000000, 0x00000000, 0x00000200, 0x00000001, 0x00010001, 0x00010000) { cpu->pc = addr; } /* Set program counter to supplied address. */ \
t(7, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004200, 0x00000000, 0x00000000, 0x00000000) { push(cpu, *reg, rs, thread); } /* Push value onto the stack. */ \
+ /* Setting/Testing/Clearing flags, and bitwise operations. */ \
+ t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000200, 0x02000200, 0x02000200) { tmp = 1; } \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 1; } \
+ t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000200, 0x02000200, 0x00000000) { tmp <<= 2; } \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 4; } \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00220222, 0x00000200) { tmp = ~tmp; } /* sbc, and clear flag. */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220022, 0x00000000, 0x02000000, 0x02000000) { tmp |= *reg; } /* ora, and set flag. */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220222, 0x00000200, 0x00000200) { tmp &= *reg; } /* AND, and clear/test flag. */ \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00220022, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp ^= *reg; } /* xor. */ \
}
#undef ORTHO_1CC