summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-24 17:31:53 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-24 17:31:53 -0400
commit1ef1029d2247095971488b3862bd2f4270720115 (patch)
treed0d74bfb2adcc8077595209d349d60a81934380e
parent587e678486edc989f35e4ae6ef5ae800036f64c9 (diff)
sux.h: Add bitmasks for writing registers.
-rw-r--r--sux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sux.h b/sux.h
index a0d26a3..0a6b964 100644
--- a/sux.h
+++ b/sux.h
@@ -1876,6 +1876,9 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00440044, 0x00000000, 0x00000000) { tmp /= *reg; *reg2 %= tmp2; } /* div. */ \
t(0, 0x00220022, 0x00000000, 0x00220022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { carry = (*reg >> (msb-(tmp2+!tmp2))) & 1; } /* rol, lsl. */ \
t(0, 0x00000000, 0x00220022, 0x00000000, 0x00000000, 0x00440044, 0x00000000, 0x00000000, 0x00440044) { carry = (*reg >> tmp2-(tmp2 != 0)) & 1; } /* ror, lsr, asr. */ \
+ /* Store modified value into register. */ \
+ t(7, 0x07660376, 0x03660376, 0x16261676, 0x02661276, 0x12760376, 0x00760376, 0x02760376, 0x02760377) { *reg = tmp; } \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x04000400, 0x04000400, 0x04000400, 0x04000400, 0x04000400) { *reg = *reg2; } /* Register transfers. */ \
}
#undef ORTHO_1CC