"""
# get the disassembly code for this instruction
if self.is_svp64_mode:
- code = self.disassembly[self._pc+4]
+ if not self.disassembly:
+ code = yield from self.get_assembly_name()
+ else:
+ code = self.disassembly[self._pc+4]
print(" svp64 sim-execute", hex(self._pc), code)
else:
- code = self.disassembly[self._pc]
+ if not self.disassembly:
+ code = yield from self.get_assembly_name()
+ else:
+ code = self.disassembly[self._pc]
print("sim-execute", hex(self._pc), code)
opname = code.split(' ')[0]
try:
pdecode = create_pdecode(include_fp=initial_fprs is not None)
gen = list(generator.generate_instructions())
+ print ("instructions gen", gen)
insncode = generator.assembly.splitlines()
- instructions = list(zip(gen, insncode))
+ if insncode:
+ instructions = list(zip(gen, insncode))
+ else:
+ instructions = gen
print ("instructions", instructions)
break
yield Settle()
- ins, code = instructions[index]
- print(" 0x{:X}".format(ins & 0xffffffff))
- opname = code.split(' ')[0]
- print(code, opname)
+ ins = instructions[index]
+ if isinstance(ins, list):
+ ins, code = ins
+ print(" 0x{:X}".format(ins & 0xffffffff))
+ opname = code.split(' ')[0]
+ print(code, opname)
+ else:
+ print(" 0x{:X}".format(ins & 0xffffffff))
# ask the decoder to decode this binary data (endian'd)
yield from simulator.execute_one()
self.binfile = BytesIO(instructions)
self.binfile.name = "assembly"
self.assembly = '' # noo disassemble number fiiive
+ print("binary", self.binfile)
elif isinstance(instructions, str): # filename
# read instructions into a BytesIO to avoid "too many open files"
with open(instructions, "rb") as f: