diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-01-29 10:57:24 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-01-29 10:57:24 -0400 |
commit | db1fafcfbad0ba8e10f130c09d47f0ebac869bfd (patch) | |
tree | aca97ebedf3bbe190cab3f5547763b1fe23a2581 | |
parent | 650254f06a6955227b241da2a19268bfc87d96ee (diff) |
sux.h: Added bitmasks for updating the status flags.
-rw-r--r-- | sux.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1879,6 +1879,13 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size, /* 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. */ \ + /* Update status flags. */ \ + t(0, 0x00000000, 0x00000000, 0x00100100, 0x00100100, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { msb = rs*8; } /* inc, dec memory. */ \ + t(0, 0x00000000, 0x00000000, 0x00000000, 0x04000400, 0x04000400, 0x04000400, 0x04000400, 0x04000400) { tmp = *reg2; } /* Register transfers. */ \ + t(0, 0x06220022, 0x00220022, 0x04220422, 0x00441044, 0x10440044, 0x00100110, 0x00320132, 0x00760176) { setflag(carry, C); } /* Update carry flag. */ \ + t(0, 0x07660376, 0x03660376, 0x16361776, 0x06761776, 0x16760576, 0x04760576, 0x04760576, 0x04760576) { setflag(tmp == 0, Z); } /* Update zero flag. */ \ + t(0, 0x06000000, 0x00000000, 0x04000400, 0x00441044, 0x10000000, 0x00100110, 0x00760176, 0x00320132) { setflag(((*reg^tmp2) >> (msb-1)) && ((*reg^tmp) >> (msb-1)), V); } /* Update overflow flag. */ \ + t(0, 0x07660376, 0x03660376, 0x16361776, 0x06761776, 0x16760576, 0x04760576, 0x04760576, 0x04760576) { setflag(tmp >> (msb-1), N); } /* Update negative flag. */ \ } #undef ORTHO_1CC |