From 6d5a40d6ac02586f52fb8865c5cfc86a42ee8453 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Sun, 8 Apr 2012 18:20:56 +0200 Subject: [PATCH] integer division --- dcpu_16.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcpu_16.py b/dcpu_16.py index ddff4ea..e2b411b 100644 --- a/dcpu_16.py +++ b/dcpu_16.py @@ -83,8 +83,8 @@ def MUL(c, a, b): @opcode(0x5) def DIV(c, a, b): """sets a to a/b, sets O to ((a<<16)/b)&0xFFFF""" - res = a() / b() - c.o = ((a() << w) / b()) & wmask + res = a() // b() + c.o = ((a() << w) // b()) & wmask a.set(res) @opcode(0x6)