From a6d2e3be40108ab9aa6b0a896117902f84bdb926 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 21 Jan 2022 14:39:45 -0400 Subject: sux.h: Add bitmasks for conditional branches. --- sux.h | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3-13-gbd6f