as.h 909 B

12345678910111213141516171819202122232425262728293031323334
  1. #define ARITH_FMT "%ld"
  2. #define INT_FMT "%d"
  3. struct t_operand {
  4. unsigned type;
  5. char *expr, *lbl;
  6. int val, reg, reg2, scale, expr2;
  7. };
  8. #define IS_QUICK 1
  9. #define IS_IMMEDIATE 2
  10. #define IS_A_REG 3
  11. #define IS_D_REG 4
  12. #define IS_REG_PAIR 5
  13. #define IS_INCR 6
  14. #define IS_DECR 7
  15. #define IS_3_OPS 8
  16. #define IS_IND_MEM 9
  17. #define IS_IND_IND 10
  18. #define IS_GLOB_LBL 11
  19. #define IS_LOC_LBL 12
  20. #define IS_IND_REG 13
  21. #define IS_IND_REG_DISPL 14
  22. #define IS_IND_REG_EDISPL 15
  23. #define QUICK( op) (op->type == IS_QUICK)
  24. #define IMMEDIATE( op) (op->type == IS_IMMEDIATE)
  25. #define A_REG( op) (op->type == IS_A_REG)
  26. #define D_REG( op) (op->type == IS_D_REG)
  27. #define REG_PAIR( op) (op->type == IS_REG_PAIR)
  28. #define INCR( op) (op->type == IS_INCR)
  29. #define REG( op) (op->type == IS_A_REG || op->type == IS_D_REG)
  30. #define LOC_LBL( op) (op->type == IS_LOC_LBL)
  31. #define GLOB_LBL( op) (op->type == IS_GLOB_LBL)