From a769f65a13db5546e427989d85f9646303f4fa32 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 8 Dec 2020 10:42:10 -0500 Subject: - Implemented support for the Orthogonal extension into both the assembler, and the emulator. I finally figured out how I could get support for the Ortho extension implemented into the old assembler. The only reason for doing this, is to buy me some while I start work on the new assembler, and to help me get an idea for how to do the same in the new assembler. --- disasm.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'disasm.h') diff --git a/disasm.h b/disasm.h index 6f978ce..3427592 100644 --- a/disasm.h +++ b/disasm.h @@ -335,3 +335,74 @@ static const char *ext_opname[0x100] = { [SWP_E ] = "SWP (E)", [PCN_E ] = "PCN (E)" }; + +#define ORTHO_1CC(mne, cc) \ + [mne##_R##cc] = #mne " r, " #cc, [mne##_M##cc] = #mne " m, " #cc + +#define ORTHO_1OP(mne) \ + [mne##_R] = #mne " r", [mne##_M] = #mne " m" + +#define ORTHO_2OP(mne) \ + [mne##_RR] = #mne " r, r", [mne##_RM] = #mne " r, m", [mne##_MR] = #mne " m, r", [mne##_MM] = #mne " m, m" + + +static const char *ortho_opname[] = { + /* 0x00-0x1C */ + ORTHO_2OP(MNG/**/), /* Move if NeGative. */ + ORTHO_2OP(ADC/**/), /* ADC Ortho. */ + ORTHO_2OP(ROR/**/), /* ROR Ortho. */ + ORTHO_2OP(ADD/**/), /* ADD Ortho. */ + ORTHO_1OP(PSH/**/), /* PuSH operand onto the stack. */ + ORTHO_1CC(SET, NG), /* SET if NeGative. */ + ORTHO_1OP(PEA/**/), /* PEA Ortho. */ + /* 0x20-0x3C */ + ORTHO_2OP(MPO/**/), /* Move if POsitive. */ + ORTHO_2OP(SBC/**/), /* SBC Ortho. */ + ORTHO_2OP(MUL/**/), /* MUL Ortho. */ + ORTHO_2OP(SUB/**/), /* SUB Ortho. */ + ORTHO_1OP(PUL/**/), /* PuLl operand off of the stack. */ + ORTHO_1CC(SET, PO), /* SET if POsitive. */ + ORTHO_1OP(SWP/**/), /* SWP Ortho. */ + /* 0x40-0x55 */ + ORTHO_2OP(MCS/**/), /* Move if Carry Set. */ + ORTHO_2OP(AND/**/), /* AND Ortho. */ + ORTHO_2OP(DIV/**/), /* DIV Ortho. */ + ORTHO_2OP(PCN/**/), /* PCN Ortho. */ + ORTHO_1OP(NOT/**/), /* NOT Ortho. */ + ORTHO_1CC(SET, CS), /* SET if Carry Set. */ + /* 0x60-0x75 */ + ORTHO_2OP(MCC/**/), /* Move if Carry Clear. */ + ORTHO_2OP(OR /**/), /* Bitwise OR. */ + ORTHO_2OP(ASR/**/), /* ASR Ortho. */ + ORTHO_2OP(LEA/**/), /* LEA Ortho. */ + ORTHO_1OP(NEG/**/), /* NEGate operand. */ + ORTHO_1CC(SET, CC), /* SET if Carry Clear. */ + /* 0x80-0x95 */ + ORTHO_2OP(MEQ/**/), /* Move if EQual. */ + ORTHO_2OP(XOR/**/), /* XOR Ortho. */ + ORTHO_2OP(CMP/**/), /* CMP Ortho. */ + ORTHO_1OP(DEC/**/), /* DEC Ortho. */ + ORTHO_1CC(SET, EQ), /* SET if EQual. */ + /* 0xA0-0xB5 */ + ORTHO_2OP(MNE/**/), /* Move if Not Equal. */ + ORTHO_2OP(LSL/**/), /* LSL Ortho. */ + ORTHO_2OP(MOV/**/), /* MOVe data from source, to destination. */ + ORTHO_1OP(INC/**/), /* INC Ortho. */ + ORTHO_1CC(SET, NE), /* SET if Not Equal. */ + /* 0xC0-0xD5 */ + ORTHO_2OP(MVS/**/), /* Move if oVerflow Set. */ + ORTHO_2OP(LSR/**/), /* LSR Ortho. */ + ORTHO_2OP(IML/**/), /* Integer MuLtiply. */ + ORTHO_1OP(CLZ/**/), /* CLZ Ortho. */ + ORTHO_1CC(SET, VS), /* SET if oVerflow Set. */ + /* 0xE0-0xF5 */ + ORTHO_2OP(MVC/**/), /* Move if oVerflow Clear. */ + ORTHO_2OP(ROL/**/), /* ROL Ortho. */ + ORTHO_2OP(IDV/**/), /* Integer DiVide. */ + ORTHO_1OP(CLO/**/), /* CLO Ortho. */ + ORTHO_1CC(SET, VC) /* SET if oVerflow Clear. */ +}; + +#undef ORTHO_1CC +#undef ORTHO_1OP +#undef ORTHO_2OP -- cgit v1.2.3-13-gbd6f