diff options
author | Jana Rekittke <jana@rekittke.name> | 2009-07-02 21:14:37 +0200 |
---|---|---|
committer | Benedikt Böhm <bb@xnull.de> | 2009-07-02 21:14:37 +0200 |
commit | 1c67357ad255533b03cb22d31b7c6cf31028fc99 (patch) | |
tree | 705dc88564544942f87a9946a54e872074ef4f74 /src/emu/cpu.c | |
parent | 87b6f874776b253f77f4a1bf4c1844d99a8e544f (diff) | |
download | swppy-1c67357ad255533b03cb22d31b7c6cf31028fc99.tar.gz swppy-1c67357ad255533b03cb22d31b7c6cf31028fc99.tar.xz swppy-1c67357ad255533b03cb22d31b7c6cf31028fc99.zip |
adapt instructions changes from back/tac.py
Diffstat (limited to 'src/emu/cpu.c')
-rw-r--r-- | src/emu/cpu.c | 32 |
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; |