From db1fafcfbad0ba8e10f130c09d47f0ebac869bfd Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 29 Jan 2022 10:57:24 -0400 Subject: sux.h: Added bitmasks for updating the status flags. --- sux.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sux.h b/sux.h index b3b78d7..3bee301 100644 --- a/sux.h +++ b/sux.h @@ -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 -- cgit v1.2.3-13-gbd6f