dosdcc.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. =**************************************************************************
  3. * File : dosdcc.h
  4. * Purpose : include file for files decompiled by dcc.
  5. * Copyright (c) Cristina Cifuentes - QUT - 1992
  6. *************************************************************************
  7. */
  8. /* Type definitions for intel 80x86 architecture */
  9. typedef unsigned int uint16_t; /* 16 bits */
  10. typedef unsigned char uint8_t; /* 8 bits */
  11. typedef union {
  12. unsigned long dW;
  13. uint16_t wL, wH; /* 2 words */
  14. } Dword; /* 32 bits */
  15. /* Structure to access high and low bits of a uint8_t or uint16_t variable */
  16. typedef struct {
  17. /* low uint8_t */
  18. uint16_t lowBitWord : 1;
  19. uint16_t filler1 : 6;
  20. uint16_t highBitByte : 1;
  21. /* high uint8_t */
  22. uint16_t lowBitByte : 1;
  23. uint16_t filler2 : 6;
  24. uint16_t highBitWord : 1;
  25. } wordBits;
  26. /* Low and high bits of a uint8_t or uint16_t variable */
  27. #define lowBit(a) ((wordBits)(a).lowBitWord)
  28. #define highBitByte(a) ((wordBits)(a).highBitByte)
  29. #define lowBitByte(a) ((wordBits)(a).lowBitByte)
  30. #define highBit(a) (sizeof(a) == sizeof(uint16_t) ? \
  31. ((wordBits)(a).highBitWord):\
  32. ((wordBits)(a).highBitByte))
  33. /* uint16_t register variables */
  34. #define ax regs.x.ax
  35. #define bx regs.x.bx
  36. #define cx regs.x.cx
  37. #define dx regs.x.dx
  38. #define cs regs.x.cs
  39. #define es regs.x.es
  40. #define ds regs.x.ds
  41. #define ss regs.x.ss
  42. #define si regs.x.si
  43. #define di regs.x.di
  44. #define bp regs.x.bp
  45. #define sp regs.x.sp
  46. /* getting rid of all flags */
  47. #define carry regs.x.cflags
  48. #define overF regs.x.flags /***** check *****/
  49. /* uint8_t register variables */
  50. #define ah regs.h.ah
  51. #define al regs.h.al
  52. #define bh regs.h.bh
  53. #define bl regs.h.bl
  54. #define ch regs.h.ch
  55. #define cl regs.h.cl
  56. #define dh regs.h.dh
  57. #define dl regs.h.dl
  58. /* High and low words of a Dword */
  59. #define highWord(w) (*((uint16_t*)&(w) + 1))
  60. #define lowWord(w) ((uint16_t)(w))
  61. #define MAXByte 0xFF
  62. #define MAXWord 0xFFFF
  63. #define MAXSignByte 0x7F
  64. #define MINSignByte 0x81
  65. #define MAXSignWord 0x7FFF
  66. #define MINSignWord 0x8001