Restructure code

In anticipation of upcoming change.
This commit is contained in:
Behdad Esfahbod 2013-11-14 20:16:41 -05:00
parent 4fab60ca5b
commit 4ff7712131

View File

@ -350,10 +350,8 @@ class Program:
try:
mnemonic, argBits, argoffset = opcodeDict[op]
except KeyError:
try:
if op in streamOpcodeDict:
mnemonic, argBits, argoffset = streamOpcodeDict[op]
except KeyError:
raise tt_instructions_error, "illegal opcode: 0x%.2x" % op
pushBytes = pushWords = 0
if argBits:
if mnemonic == "PUSHB":
@ -384,6 +382,8 @@ class Program:
value = value - 0x10000
assembly.append(`value`)
i = i + 2
else:
raise tt_instructions_error, "illegal opcode: 0x%.2x" % op
else:
if argBits:
assembly.append(mnemonic + "[%s]" % num2binary(op - argoffset, argBits))