Restructure code
In anticipation of upcoming change.
This commit is contained in:
parent
4fab60ca5b
commit
4ff7712131
@ -350,10 +350,8 @@ class Program:
|
|||||||
try:
|
try:
|
||||||
mnemonic, argBits, argoffset = opcodeDict[op]
|
mnemonic, argBits, argoffset = opcodeDict[op]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
try:
|
if op in streamOpcodeDict:
|
||||||
mnemonic, argBits, argoffset = streamOpcodeDict[op]
|
mnemonic, argBits, argoffset = streamOpcodeDict[op]
|
||||||
except KeyError:
|
|
||||||
raise tt_instructions_error, "illegal opcode: 0x%.2x" % op
|
|
||||||
pushBytes = pushWords = 0
|
pushBytes = pushWords = 0
|
||||||
if argBits:
|
if argBits:
|
||||||
if mnemonic == "PUSHB":
|
if mnemonic == "PUSHB":
|
||||||
@ -384,6 +382,8 @@ class Program:
|
|||||||
value = value - 0x10000
|
value = value - 0x10000
|
||||||
assembly.append(`value`)
|
assembly.append(`value`)
|
||||||
i = i + 2
|
i = i + 2
|
||||||
|
else:
|
||||||
|
raise tt_instructions_error, "illegal opcode: 0x%.2x" % op
|
||||||
else:
|
else:
|
||||||
if argBits:
|
if argBits:
|
||||||
assembly.append(mnemonic + "[%s]" % num2binary(op - argoffset, argBits))
|
assembly.append(mnemonic + "[%s]" % num2binary(op - argoffset, argBits))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user