Created
March 4, 2013 19:10
-
-
Save cassiebeckley/5084587 to your computer and use it in GitHub Desktop.
galaxpy.saturn test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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