From d9531376fc8af55428025b608f57faec84a713c0 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Mon, 29 Feb 2016 13:27:52 -0800 Subject: [PATCH] udis: simplified flag logical operations --- udis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/udis.py b/udis.py index 8e3aa0c..6f4c16c 100755 --- a/udis.py +++ b/udis.py @@ -182,7 +182,7 @@ while True: # Handle relative addresses. Indicated by the flag pcr being set. # Assumes the operand that needs to be PC relative is the last one. # Note: Code will need changes if more flags are added. - if flags & 1 == pcr: + if flags & pcr: if op[length-1] < 128: op[length-1] = address + op[length-1] + length else: @@ -196,7 +196,7 @@ while True: elif length == 2: operand = format.format(op[1]) elif length == 3: - if flags & 4 == z80bit: + if flags & z80bit: opcode = (opcode << 16) + op[2] # reread opcode table for real format string length, mnemonic, mode, flags = opcodeTable[opcode]