mirror of
https://github.com/lloeki/python-dcpu_16.git
synced 2025-12-06 09:54:39 +01:00
exception isolation
This commit is contained in:
parent
6f493aab4e
commit
39ac76aa4f
1 changed files with 2 additions and 1 deletions
|
|
@ -378,10 +378,11 @@ class CPU(object):
|
||||||
op = _opcode_map[opcode]
|
op = _opcode_map[opcode]
|
||||||
try:
|
try:
|
||||||
op = op[a_code]
|
op = op[a_code]
|
||||||
args = (c._pointer(b_code),)
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
args = (c._pointer(a_code),
|
args = (c._pointer(a_code),
|
||||||
c._pointer(b_code))
|
c._pointer(b_code))
|
||||||
|
else:
|
||||||
|
args = (c._pointer(b_code),)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise Exception('Invalid opcode %s at PC=%04X' % (["%02X"%x for x in opcode], c.pc))
|
raise Exception('Invalid opcode %s at PC=%04X' % (["%02X"%x for x in opcode], c.pc))
|
||||||
return op, args
|
return op, args
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue