X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fxa.src%2Fglob.h;h=be31e94c8097c76be90ef54184b8afde11e17c4d;hb=011a73edf0a9ef1e9c50cdf01c94050bbfc70bdf;hp=b8a4284e6c26b36d206286bb80219b81a2d98212;hpb=a6209c13974db8d38261366f3460a920189239b3;p=fw%2Fsdcc diff --git a/sim/ucsim/xa.src/glob.h b/sim/ucsim/xa.src/glob.h index b8a4284e..be31e94c 100644 --- a/sim/ucsim/xa.src/glob.h +++ b/sim/ucsim/xa.src/glob.h @@ -3,9 +3,10 @@ * * Copyright (C) 1999,99 Drotos Daniel, Talker Bt. * - * Written by Karl Bongers karl@turbobit.com - * * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu + * Other contributors include: + * Karl Bongers karl@turbobit.com, + * Johan Knol johan.knol@iduna.nl * */ @@ -32,84 +33,94 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "stypes.h" - -#if 0 -enum { - REG, - IND_REG, - IND_REG_PLUS, - IND_REG_OFFSET, - DIRECT, - DATA8, - DATA16 -}; -#endif - +/* this needs to match char *op_mnemonic_str[] definition in glob.cc */ enum { BAD_OPCODE=0, ADD, ADDC, -SUB, -SUBB, -CMP, -AND, -OR, -XOR, ADDS, -NEG, -SEXT, -MUL, +AND, +ANL, +ASL, +ASR, +BCC, +BCS, +BEQ, +BG, +BGE, +BGT, +BKPT, +BL, +BLE, +BLT, +BMI, +BNE, +BNV, +BOV, +BPL, +BR, +CALL, +CJNE, +CLR, +CMP, +CPL, +DA, DIV_w, DIV_d, DIVU_b, DIVU_w, DIVU_d, -DA, -ASL, -ASR, +DJNZ, +FCALL, +FJMP, +JB, +JBC, +JMP, +JNB, +JNZ, +JZ, LEA, -CPL, LSR, +MOV, +MOVC, +MOVS, +MOVX, +MUL_w, +MULU_b, +MULU_w, +NEG, +NOP, NORM, +OR, +ORL, +POP, +POPU, +PUSH, +PUSHU, +RESET, +RET, +RETI, RL, RLC, RR, RRC, -MOVS, -MOVC, -MOVX, -PUSH, -POP, -XCH, SETB, -CLR, -MOV, -ANL, -ORL, -BR, -JMP, -CALL, -RET, -Bcc, -BEQ, -JB, -JNB, -CJNE, -DJNZ, -JZ, -JNZ, -NOP, -BKPT, +SEXT, +SUB, +SUBB, TRAP, -RESET, -FCALL, -FJMP, +XCH, +XOR, }; extern char *op_mnemonic_str[]; +/* this classifies the operands and is used in the dissassembly + to print the operands. Its also used in the simulation to characterize + the op-code function. + */ enum op_operands { - // the repeating common parameter encoding for ADD, ADDC, SUB, AND... + // the repeating parameter encoding for ADD, ADDC, SUB, SUBB, AND, XOR, ... REG_REG , REG_IREG , IREG_REG , @@ -136,41 +147,67 @@ enum op_operands { // odd-ball ones NO_OPERANDS, // for NOP - C_BIT, - C_NOTBIT, + CY_BIT, + BIT_CY, + CY_NOTBIT, + DATA4, REG_DATA4, + REG_DATA5, IREG_DATA4, IREGINC_DATA4, IREGOFF8_DATA4, IREGOFF16_DATA4, DIRECT_DATA4, - REG_ALONE, - IREG_ALONE, + REG, + IREG, + BIT_ALONE, + DIRECT, + DIRECT_DIRECT, + RLIST, ADDR24, + BIT_REL8, REG_REL8, DIRECT_REL8, + REG_REGOFF8, + REG_REGOFF16, + + REG_USP, + USP_REG, REL8, REL16, + + REG_DIRECT_REL8, + REG_DATA8_REL8, + REG_DATA16_REL8, + IREG_DATA8_REL8, + IREG_DATA16_REL8, + + A_APLUSDPTR, + A_APLUSPC, + A_PLUSDPTR, + IIREG }; // table of dissassembled instructions struct xa_dis_entry { - uint code, mask; - char branch; - uchar length; -// enum op_mnemonic mnemonic; -// enum op_operands operands; - int mnemonic; - int operands; + uint is1byte; /* only grab 1 byte for table lookup(most are 2 bytes) */ + uint code; /* bits in opcode used to match table entry(with mask) */ + uint mask; /* mask used on .code to match up a common opcode */ + char branch; /* used by main app to implement "next" around calls */ + uchar length; /* total length of opcode, used by dissasembler and main app */ + int mnemonic; /* type of opcode(ADD, ADDC...) */ + int operands; /* unique classification of operands: Rd,Rs = REG_REG,... */ }; extern struct dis_entry glob_disass_xa[]; extern struct xa_dis_entry disass_xa[]; +extern struct name_entry sfr_tabXA51[]; +extern struct name_entry bit_tabXA51[]; #endif /* End of xa.src/glob.h */