from pprint import pprint from instruction_table import untabulate_instructions_sh2 from instruction_table import untabulate_instructions_sh4 sh2 = untabulate_instructions_sh2() sh4 = untabulate_instructions_sh4() all_sh2 = set([(i.instruction, i.operands) for i in sh2]) all_sh4 = set([(i.instruction, i.operands) for i in sh4]) max_instruction = max(len(i.instruction) for i in [*sh2, *sh4]) max_operands = max(len(i.operands) for i in [*sh2, *sh4]) print("only in sh2:") for i in sh2: if (i.instruction, i.operands) not in all_sh4: print(i.instruction, i.operands) print() print("only in sh4:") for i in sh4: if (i.instruction, i.operands) not in all_sh2: print(i.instruction.ljust(max_instruction + 1), i.operands.ljust(max_operands + 1), i.operation) print() print("sh2", len(sh2)) print("sh4", len(sh4))