as.h 829 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #define UNKNOWN 0
  2. #define IS_REG 0x1
  3. #define IS_ACCU 0x2
  4. #define IS_DATA 0x4
  5. #define IS_LABEL 0x8
  6. #define IS_MEM 0x10
  7. #define IS_ADDR 0x20
  8. #define IS_ILB 0x40
  9. #define AX 0
  10. #define BX 3
  11. #define CX 1
  12. #define DX 2
  13. #define CL 1
  14. #define SP 4
  15. #define BP 5
  16. #define SI 6
  17. #define DI 7
  18. #define REG( op) ( op->type & IS_REG)
  19. #define ACCU( op) ( op->type & IS_REG && op->reg == AX)
  20. #define REG_CL( op) ( op->type & IS_REG && op->reg == CL)
  21. #define DATA( op) ( op->type & IS_DATA)
  22. #define lABEL( op) ( op->type & IS_LABEL)
  23. #define ILB( op) ( op->type & IS_ILB)
  24. /*#define MEM( op) ( op->type & IS_MEM)*/
  25. #define ADDR( op) ( op->type & IS_ADDR)
  26. #define EADDR( op) ( op->type & ( IS_ADDR | IS_MEM | IS_REG))
  27. #define TRUE 1
  28. #define FALSE 0
  29. struct t_operand {
  30. unsigned type;
  31. int reg;
  32. char *expr, *lab, *off;
  33. };