mirror of
https://github.com/jefftranter/udis.git
synced 2024-06-12 04:29:27 +00:00
udis: simplified flag logical operations
This commit is contained in:
parent
f8d8de1bcc
commit
d9531376fc
4
udis.py
4
udis.py
|
@ -182,7 +182,7 @@ while True:
|
||||||
# Handle relative addresses. Indicated by the flag pcr being set.
|
# Handle relative addresses. Indicated by the flag pcr being set.
|
||||||
# Assumes the operand that needs to be PC relative is the last one.
|
# Assumes the operand that needs to be PC relative is the last one.
|
||||||
# Note: Code will need changes if more flags are added.
|
# Note: Code will need changes if more flags are added.
|
||||||
if flags & 1 == pcr:
|
if flags & pcr:
|
||||||
if op[length-1] < 128:
|
if op[length-1] < 128:
|
||||||
op[length-1] = address + op[length-1] + length
|
op[length-1] = address + op[length-1] + length
|
||||||
else:
|
else:
|
||||||
|
@ -196,7 +196,7 @@ while True:
|
||||||
elif length == 2:
|
elif length == 2:
|
||||||
operand = format.format(op[1])
|
operand = format.format(op[1])
|
||||||
elif length == 3:
|
elif length == 3:
|
||||||
if flags & 4 == z80bit:
|
if flags & z80bit:
|
||||||
opcode = (opcode << 16) + op[2]
|
opcode = (opcode << 16) + op[2]
|
||||||
# reread opcode table for real format string
|
# reread opcode table for real format string
|
||||||
length, mnemonic, mode, flags = opcodeTable[opcode]
|
length, mnemonic, mode, flags = opcodeTable[opcode]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user