Implement 386 instruction table, improve 8086/186/286 instruction table
[multi_emu.git] / instr_z80.py
1 #!/usr/bin/env python3
2
3 import z80dis.z80
4
5 prefixes = [[], [0xcb], [0xdd], [0xdd, 0xcb], [0xed], [0xfd], [0xfd, 0xcb]]
6 for i in prefixes:
7   print('opcodes{0:s}'.format(''.join([f' 0x{j:02x}' for j in i])))
8   for j in range(0x100):
9     k = i + [j]
10     print(
11       z80dis.z80.disasm(
12         # for DDCB and FDCB the displacement goes before the next opcode
13         bytes(k[:2] + [0x12] + k[2:] + [0x34])
14       )
15     )
16   print()