From 060ed1662f82e1159b3d1d1676f9848954cbbee9 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Sun, 8 Apr 2012 18:25:00 +0200 Subject: [PATCH] fixing conditionals --- dcpu_16.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dcpu_16.py b/dcpu_16.py index 78de45b..0372c1e 100644 --- a/dcpu_16.py +++ b/dcpu_16.py @@ -135,24 +135,32 @@ def XOR(c, a, b): def IFE(c, a, b): """performs next instruction only if a==b""" if a() == b(): + c.skip = False + else: c.skip = True @opcode(0xD) def IFN(c, a, b): """performs next instruction only if a!=b""" if a() != b(): + c.skip = False + else: c.skip = True @opcode(0xE) def IFG(c, a, b): """performs next instruction only if a>b""" if a() > b(): + c.skip = False + else: c.skip = True @opcode(0xF) def IFB(c, a, b): """performs next instruction only if (a&b)!=0""" if (a() & b()) != 0: + c.skip = False + else: c.skip = True