From 1c67357ad255533b03cb22d31b7c6cf31028fc99 Mon Sep 17 00:00:00 2001 From: Jana Rekittke Date: Thu, 2 Jul 2009 21:14:37 +0200 Subject: adapt instructions changes from back/tac.py --- src/emu/cpu.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'src/emu/cpu.c') 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; -- cgit v1.2.3