home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dosdisas.zip / dccsrcoo.zip / dosdcc.h < prev    next >
Text File  |  1997-04-09  |  2KB  |  81 lines

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