mirror of
https://github.com/lloeki/python-dcpu_16.git
synced 2025-12-06 09:54:39 +01:00
integer division
This commit is contained in:
parent
0b1f2a84ef
commit
6d5a40d6ac
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue