Skip to content

Commit

Permalink
almost there!
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschaer committed Aug 2, 2019
1 parent 2610d17 commit 62db321
Show file tree
Hide file tree
Showing 8 changed files with 1,266 additions and 582 deletions.
11 changes: 6 additions & 5 deletions execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def __init__(self, start_address, starting_ram={}, starting_registers={}):
self.write_hex_str_to_ram(key, val)
self.cr0 = None
self.cr1 = None
self.ret = [] # list of values to return

def print_line(self):
print(hex(self.current_address), SOURCE[self.current_address])
Expand Down Expand Up @@ -52,6 +51,10 @@ def read_hex_str_from_ram(self, address, byte_len):
"""
read specified number of bytes from ram starting at given address
"""
if address in (0x809e5474, 0x809e5475, 0x809e5476, 0x809e5478,
0x809e547c, 0x809e547d, 0x809e547e, 0x809e547f):
print("reading from current position")

ret = ""
for i in range(byte_len):
try:
Expand All @@ -75,7 +78,7 @@ def print_registers(self):

def execute(self):
DEBUG = False
breakpoints = [0x800a3a78]
breakpoints = []

while not self.end_reached:

Expand All @@ -92,7 +95,7 @@ def execute(self):
self.print_line()
input("press Enter to run line")

f = method_to_call = getattr(functions, args[0].strip("-+"))
f = method_to_call = getattr(functions, args[0].strip("-+."))

try:
f(self, *args[1:])
Expand All @@ -105,5 +108,3 @@ def execute(self):
if DEBUG:
self.print_registers()
self.print_ram()

return self.ret
Loading

0 comments on commit 62db321

Please sign in to comment.