home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / asm / bmac.arc / DOS.MAC < prev    next >
Text File  |  1988-07-27  |  2KB  |  123 lines

  1. ; LM8086.MAC  13 Dec 83  Craig Milo Rogers at USC/ISI
  2. ;    Prevent multiply defined GROUPs.
  3.  
  4. ;**
  5. ;
  6. ; This macro library defines the operating environment for the 8086 large
  7. ; model, which allows 1Mbyte for program and 1 Mbyte for data.
  8. ;
  9. ;**
  10.  
  11. ;**
  12. ;
  13. ; The following symbols define the 8086 memory mode being used.  Set LPROG
  14. ; to 1 for a large program segment (greater than 64K-bytes), and set LDATA
  15. ; to 1 for a large data segment.
  16. ;
  17. ;**
  18. LPROG    EQU    0
  19. LDATA    EQU    0
  20.  
  21. ;**
  22. ;
  23. ; The following symbols are established via LPROG and LDATA as follows:
  24. ;
  25. ;    S8086    set for small model (small prog, small data)
  26. ;    D8086    set for model with large data, small prog
  27. ;    P8086    set for model with large prog, small data
  28. ;    L8086    set for large model
  29. ;
  30. ;**
  31.     IF    (LPROG EQ 0) AND (LDATA EQ 0)
  32. S8086    EQU    1
  33. D8086    EQU     0
  34. P8086    EQU    0
  35. L8086    EQU    0
  36.     ENDIF
  37.  
  38.     IF    (LPROG EQ 0) AND (LDATA NE 0)
  39. S8086    EQU    0
  40. D8086    EQU    1
  41. P8086    EQU    0
  42. L8086    EQU    0
  43.     ENDIF
  44.  
  45.     IF    (LPROG NE 0) AND (LDATA EQ 0)
  46. S8086    EQU    0
  47. D8086    EQU    0
  48. P8086    EQU    1
  49. L8086    EQU    0
  50.     ENDIF
  51.  
  52.     IF    (LPROG NE 0) AND (LDATA NE 0)
  53. S8086    EQU    0
  54. D8086    EQU    0
  55. P8086    EQU    0
  56. L8086    EQU    1
  57.     ENDIF
  58.  
  59.  
  60. ;**
  61. ;
  62. ; The DSEG and PSEG macros are defined to generate the appropriate GROUP
  63. ; and SEGMENT statements for the memory model being used.  The ENDDS and
  64. ; ENDPS macros are then used to end the segments.
  65. ;
  66. ;**
  67. DSEG    MACRO    
  68.     IFNDEF    DGROUP
  69. DGROUP    GROUP    DATA
  70.     ENDIF
  71. DATA    SEGMENT    WORD PUBLIC 'DATA'
  72.     ASSUME    DS:DATA
  73.     ENDM
  74. ENDDS    MACRO
  75. DATA    ENDS
  76.     ENDM
  77.  
  78.     IF    S8086
  79. PSEG    MACRO
  80.     IFNDEF    PGROUP
  81. PGROUP    GROUP    PROG
  82.     ENDIF
  83. PROG    SEGMENT    BYTE PUBLIC 'PROG'
  84.     ASSUME    CS:PROG
  85.     ENDM
  86. ENDPS    MACRO
  87. PROG    ENDS
  88.     ENDM
  89.     ENDIF
  90.  
  91.     IF    D8086
  92. PSEG    MACRO
  93.     IFNDEF    CGROUP
  94. CGROUP    GROUP    CODE
  95.     ENDIF
  96. CODE    SEGMENT    BYTE PUBLIC 'CODE'
  97.     ASSUME    CS:CODE
  98.     ENDM
  99. ENDPS    MACRO
  100. CODE    ENDS
  101.     ENDM
  102.     ENDIF
  103.  
  104.     IF    P8086
  105. PSEG    MACRO
  106. _CODE    SEGMENT    BYTE
  107.     ASSUME    CS:_CODE
  108.     ENDM
  109. ENDPS    MACRO
  110. _CODE    ENDS
  111.     ENDM
  112.     ENDIF
  113.  
  114.     IF    L8086
  115. PSEG    MACRO
  116. _PROG    SEGMENT    BYTE
  117.     ASSUME    CS:_PROG
  118.     ENDM
  119. ENDPS    MACRO
  120. _PROG    ENDS
  121.     ENDM
  122.     ENDIF
  123.