(src, dst) = decode_header(self.cmd_bytes[i]['val'])
str = 'HDR: ' + src + ', ' + dst
elif i == 1: # Parse opcode
- str += ' | OPC: ' + decode_opcode(self.cmd_bytes[i]['val'])
+ str += ' | OPC: ' + opcodes.get(self.cmd_bytes[i]['val'], 'Invalid')
else: # Parse operands
if operands == 0:
str += ' | OPS: '
src = (header & 0xF0) >> 4
dst = (header & 0x0F)
return (resolve_logical_address(src, 1), resolve_logical_address(dst, 0))
-
-def decode_opcode(opcode):
- if opcode in opcodes:
- return opcodes[opcode]
- else:
- return 'Invalid'