home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d110 / pdc.lha / Pdc / src / Gen.h < prev    next >
C/C++ Source or Header  |  1987-10-28  |  2KB  |  48 lines

  1. /*
  2.  *      code generation structures and constants
  3.  */
  4.  
  5. #define F_DREG  1       /* data register direct mode allowed */
  6. #define F_AREG  2       /* address register direct mode allowed */
  7. #define F_MEM   4       /* memory alterable modes allowed */
  8. #define F_IMMED 8       /* immediate mode allowed */
  9. #define F_ALT   7       /* alterable modes */
  10. #define F_DALT  5       /* data alterable modes */
  11. #define F_ALL   15      /* all modes allowed */
  12. #define F_VOL   16      /* need volitile operand */
  13. #define F_NOVALUE 32    /* dont need result value */
  14.  
  15. enum e_op {
  16.         op_move, op_moveq, op_add, op_addi, op_addq, op_sub, op_subi,
  17.         op_subq, op_muls, op_mulu, op_divs, op_divu, op_and, op_andi,
  18.         op_or, op_ori, op_eor, op_asl, op_asr, op_jmp, op_jsr, op_movem,
  19.         op_rts, op_bra, op_beq, op_bne, op_blt, op_ble, op_bgt, op_bge,
  20.         op_bhi, op_bhs, op_blo, op_bls, op_tst, op_ext, op_lea, op_swap,
  21.         op_neg, op_not, op_cmp, op_clr, op_link, op_unlk, op_label,
  22.         op_pea, op_cmpi, op_dc };
  23.  
  24. enum e_am {
  25.         am_dreg, am_areg, am_ind, am_ainc, am_adec, am_indx, am_indx2,
  26.         am_xpc, am_direct, am_immed, am_mask, am_none, am_indx3 };
  27.  
  28.  
  29. /*      addressing mode structure       */
  30.  
  31. struct amode {
  32.         enum e_am       mode;
  33.         enum e_am       preg;
  34.         enum e_am       sreg;
  35.         char            tempflag;
  36.         int             deep;           /* stack depth on allocation */
  37.         struct enode    *offset;
  38.         };
  39.  
  40. /*      output code structure   */
  41.  
  42. struct ocode {
  43.         struct ocode    *fwd, *back;
  44.         enum e_op       opcode;
  45.         short           length;
  46.         struct amode    *oper1, *oper2;
  47.         };
  48.