Disassembler - Z80
def recursive_disassemble(start, memory, visited): pc = start while pc < len(memory) and pc not in visited: visited.add(pc) insn, length = decode_one(pc, memory) print(f"pc:04X: insn") # simplistic flow analysis if "JP" in insn and "$" in insn: target = int(insn.split("$")[1], 16) if target not in visited: recursive_disassemble(target, memory, visited) break # unconditional jump elif "RET" in insn or "RETI" in insn or "RETN" in insn: break else: pc += length
Pseudo-structure in C:
“To disassemble is to understand; to understand is to preserve.” z80 disassembler
In the world of retrocomputing, a reliable Z80 disassembler is a time machine. It lets you peer into the minds of 1980s programmers, decode their clever memory-saving tricks, and preserve digital history—one opcode at a time. length = decode_one(pc
