Fixed signed integer printing
This commit is contained in:
parent
26ae9ab526
commit
53409c6f49
|
@ -9,7 +9,7 @@ class tty(Device):
|
|||
def __setitem__(self, index: int, value: int):
|
||||
if index & 0xf == 0xd:
|
||||
if value & 0x800:
|
||||
print(((~(value & 0x7FF)) + 1) * -1)
|
||||
print((((value & 0x7FF) ^ 0x7FF) + 1) * -1)
|
||||
else:
|
||||
print(value)
|
||||
elif index & 0xf == 0xe:
|
||||
|
|
|
@ -11,7 +11,7 @@ def main(argv: Sequence[str] | None = None):
|
|||
from time import sleep
|
||||
|
||||
machines = {
|
||||
'tty': lambda rom: Computer(Memory(rom, [tty(0x7FE, 0x7FF)]))
|
||||
'tty': lambda rom: Computer(Memory(rom, [tty(0x7FD, 0x7FF)]))
|
||||
}
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
|
|
|
@ -13,7 +13,7 @@ main:
|
|||
loop:
|
||||
; Output current value
|
||||
liu 0x1f
|
||||
lil 0x3E
|
||||
lil 0x3D
|
||||
str D0
|
||||
|
||||
; Move values down
|
||||
|
|
Loading…
Reference in New Issue