summaryrefslogtreecommitdiffstats
path: root/src/emu/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu.c')
-rw-r--r--src/emu/cpu.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/emu/cpu.c b/src/emu/cpu.c
index 5256cb6..7e62ffb 100644
--- a/src/emu/cpu.c
+++ b/src/emu/cpu.c
@@ -198,29 +198,27 @@ void execute(uint32_t IR)
Z = (GPR[a] == GPR[b]);
N = (GPR[a] < GPR[b]);
break;
- case OPC_BEQ:
- if (Z)
+ case OPC_BEZ:
+ if (GPR[a] == 0)
PC += c * sizeof(uint32_t);
break;
- case OPC_BNE:
- if (!Z)
- PC += c * sizeof(uint32_t);
+ case OPC_EQ:
+ GPR[a] = Z;
break;
- case OPC_BLT:
- if (N)
- PC += c * sizeof(uint32_t);
+ case OPC_NE:
+ GPR[a] = !Z;
break;
- case OPC_BGE:
- if (!N)
- PC += c * sizeof(uint32_t);
+ case OPC_LT:
+ GPR[a] = N;
break;
- case OPC_BLE:
- if (Z || N)
- PC += c * sizeof(uint32_t);
+ case OPC_LE:
+ GPR[a] = Z || N;
break;
- case OPC_BGT:
- if (!Z && !N)
- PC += c * sizeof(uint32_t);
+ case OPC_GE:
+ GPR[a] = !N;
+ break;
+ case OPC_GT:
+ GPR[a] = !Z && !N;
case OPC_J:
PC = GPR[a];
break;