Esempio n. 1
0
def machine_disasm_block_test():
    mach = Machine()
    disasm = DisAsm(mach)
    buf = b"\x4e\x75" + b"\x10\x1c" + b"\x48\xe7\x3f\x3e"
    assert disasm.disassemble_block(buf, 0x100) == [
        (0x100, [0x4e75], "rts"), (0x102, [0x101c], "move.b  (A4)+, D0"),
        (0x104, [0x48e7, 0x3f3e], "movem.l D2-D7/A2-A6, -(A7)")
    ]
Esempio n. 2
0
def machine_disasm_block_dump_test():
    mach = Machine()
    disasm = DisAsm(mach)
    buf = b"\x4e\x75" + b"\x10\x1c" + b"\x48\xe7\x3f\x3e" + b"\x48\xe7"
    code = disasm.disassemble_block(buf, 0x100)
    result = []

    def store(line):
        result.append(line)

    disasm.dump_block(code, store)
    assert result == [
        "00000100:  4e75                  rts",
        "00000102:  101c                  move.b  (A4)+, D0",
        "00000104:  48e7 3f3e             movem.l D2-D7/A2-A6, -(A7)"
    ]