Skip to content

Instantly share code, notes, and snippets.

@cassiebeckley
Created March 4, 2013 19:10
Show Gist options
  • Save cassiebeckley/5084587 to your computer and use it in GitHub Desktop.
Save cassiebeckley/5084587 to your computer and use it in GitHub Desktop.
galaxpy.saturn test
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from galaxpy import saturn
>>> cpu = saturn.dcpu()
>>> cpu.PC
0
>>> cpu.A
0
>>> cpu[0]
0
>>> cpu[0xdead]
0
>>> cpu.A = 0xdeac
>>> cpu.flash([0x8802])
>>> hex(cpu[0])
'0x8802'
>>> cpu.PC
0
>>> cpu.cycle()
>>> cpu.PC
1
>>> hex(cpu.A)
'0xdead'
>>> cpu.reset()
>>> cpu[0]
0
>>> cpu.A
0
>>> cpu.flash([0x7c01, 0x0f00, 0x7fc1, 0x0001, 0xdead, 0x03c2, 0xdead])
>>> while True:
... cpu.cycle()
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
saturn.InvalidOpcodeError: failed to execute invalid opcode
>>> hex(cpu.PC)
'0x8'
>>> hex(cpu.A)
'0xf00'
>>> hex(cpu[0xdead])
'0xf01'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment