"CC flags", "example", "op code", "bytes", "cycles", "address mode", "needs ea", "read from memory", "write to memory", "register", ) # Collect the data for the table from MC6809_data_raw2 data = [] for instruction, instr_data in sorted(OP_DATA.items()): for mnemonic, memoric_data in sorted(instr_data["mnemonic"].items()): instruction_doc = OP_DOC[instruction] mnemonic_doc = instruction_doc["mnemonic"][mnemonic] for op_code, op_data in sorted(memoric_data["ops"].items()): addr_mode = op_data["addr_mode"] if addr_mode: addr_mode = addr_mode.replace("_", " ").lower() if op_code > 0xff: op_code = "$%04x" % op_code else: op_code = "$%02x" % op_code