home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / GRDBDL17.ZIP / IOPERAND.INC < prev    next >
Encoding:
Text File  |  1997-10-16  |  2.0 KB  |  157 lines

  1. ;
  2. ; GRDB
  3. ;
  4. ; Copyright(c) LADsoft
  5. ;
  6. ; David Lindauer, gclind01@starbase.spd.louisville.edu
  7. ;
  8. FALSE = 0
  9. TRUE = 1
  10.  
  11. TAB_ARGPOS =12
  12.  
  13. REG_eAX =0
  14. REG_DX =2
  15.  
  16. OM_FSTREG =18
  17. OM_CRX  =17
  18. OM_DRX  =16
  19. OM_TRX  =15
  20. OM_SUD  =13
  21. OM_PORT      =    12
  22. OM_INT    = 11
  23. OM_SHIFT   =10
  24. OM_RETURN  =9
  25. OM_SHORTBRANCH  =8
  26. OM_LONGBRANCH  =7
  27. OM_FARBRANCH  =6
  28. OM_ABSOLUTE  =5
  29. OM_IMMEDIATE = 4
  30. OM_REG  =3
  31. OM_SEGMENT  =2
  32. OM_BASED =1
  33.  
  34. ;// Generic
  35. OMF_ADR32 =0
  36. OMF_OP32 =1
  37. OMF_BYTE =2
  38. OMF_FST =3
  39. OMF_FSTTAB =4
  40. OM_FTAB =5
  41. OMF_BASE = 8
  42. ;// base & immediate specific
  43. OMF_SCALED =OMF_BASE
  44. OMF_SIGNED_OFFSET = OMF_BASE + 1
  45. OMF_WORD_OFFSET =(OMF_BASE + 2)
  46. OMF_OFFSET =((1 SHL OMF_SIGNED_OFFSET) OR (1 SHL OMF_WORD_OFFSET))
  47. ;// shift specific
  48. OMF_CL    =OMF_BASE
  49. ;// Port specific
  50. OMF_DX  =OMF_BASE
  51. ;// Immediate specific
  52. OMF_SIGNED =OMF_BASE
  53.  
  54. SG_ES =1
  55. SG_CS =2
  56. SG_SS =4
  57. SG_DS =8
  58. SG_FS =16
  59. SG_GS =32
  60. SG_OPSIZ =64
  61. SG_ADRSIZ =128
  62. SG_REPNZ =256
  63. SG_REPZ =512
  64. SG_REPNC =1024
  65. SG_REPC =2048
  66. SG_TWOBYTEOP =4096
  67.  
  68. SY_SIGNEDOFS =1
  69. SY_WORDOFS =2
  70. SY_BYTEOFS =3
  71. SY_ABSOLUTE =4
  72. SY_SIGNEDIMM =5
  73. SY_WORDIMM =6
  74. SY_BYTEIMM =7
  75. SY_PORT =8
  76. SY_INTR =9
  77. SY_RETURN =10
  78. SY_ABSBRANCH =11
  79. SY_LONGBRANCH =12
  80. SY_SHORTBRANCH =13
  81. SY_SHIFT =14
  82. SY_SEGMENT =15
  83.  
  84. MOD_NOOFS =0
  85. MOD_SIGNED =1
  86. MOD_ADDR =2
  87. MOD_REG =3
  88.  
  89. RM_16_ABSOLUTE =6
  90. RM_32_ABSOLUTE =5
  91. RM_32_SCALED =4
  92. RM_32_STACKINDEX =4
  93.  
  94. MODX    MACRO    rrr
  95.     mov    al,fs:[rrr + 1]
  96.     shr    al,6
  97. ENDM
  98.  
  99. REG    MACRO    rrr
  100.     mov    al,fs:[rrr + 1]
  101.     shr    al,3
  102.     and    al,7
  103. ENDM
  104.  
  105. RM    MACRO    rrr
  106.     mov    al,fs:[rrr + 1]
  107.     and    al,7
  108. ENDM
  109.  
  110. LONG    MACRO    rrr
  111.     mov    eax,fs:[rrr]
  112. ENDM
  113.  
  114. UINT    MACRO    rrr
  115.     movzx    eax,word ptr fs:[rrr]
  116. ENDM
  117.  
  118. SIGNEDOFS     MACRO    rrr
  119.     movsx    eax,fs:[rrr]
  120. ENDM
  121.  
  122. B01    MACRO
  123.     and    al,3
  124. ENDM
  125.  
  126. B12    MACRO
  127.     shr    eax,1
  128.     and    al,3
  129. ENDM
  130.  
  131. B02    MACRO
  132.     and    al,7
  133. ENDM
  134.  
  135. B35    MACRO
  136.     shr    eax,3
  137.     and    al,7
  138. ENDM
  139.  
  140. B45    MACRO
  141.     shr    eax,4
  142.     and    al,3
  143. ENDM
  144.  
  145. operand    STRUC
  146. oeflags        dw    ?
  147. override    dw    ?
  148. address        dd    ?
  149. oeseg        dw    ?
  150. code        db    ?
  151. thereg        db    ?
  152. scalereg     db    ?
  153. scale        db    ?
  154. operand ENDS
  155.  
  156. OPERANDSIZE = SIZEOF operand
  157.