home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / adlibmsc / lowlevel / common.mac < prev    next >
Encoding:
Text File  |  1988-10-17  |  1.4 KB  |  63 lines

  1. ;14-oct-88, Dale Glowinski
  2. ;Modifications made to support C compilers which place an underscore before
  3. ;procedure names.  Define UNDERLINE in the file version.inc in order to
  4. ;use this feature.
  5. ;EXTERN and P_END macros added. BEGIN macro modified.
  6.  
  7.  
  8. ;-------------------------------- EXTERN -----------------------------------
  9. EXTERN  MACRO  name
  10.    IF UNDERLINE
  11.     IF  LPROG
  12.       extrn _&name:  far
  13.     ELSE
  14.       extrn _&name:  near
  15.     ENDIF
  16.    ELSE
  17.     IF  LPROG
  18.       extrn name:  far
  19.     ELSE
  20.       extrn name:  near
  21.     ENDIF
  22.    ENDIF
  23. ENDM
  24.  
  25. ;-------------------------------- P_END ------------------------------------
  26. P_END  MACRO  name
  27.    IF UNDERLINE
  28.       _&name  endp
  29.    ELSE
  30.       name  endp
  31.    ENDIF
  32. ENDM
  33.  
  34. ;-------------------------------- BEGIN ------------------------------------
  35. ;**
  36. ;
  37. ; The BEGIN and ENTRY macros establish appropriate function entry points
  38. ; depending on whether NEAR or FAR program addressing is being used.  The
  39. ; only difference between the two is that BEGIN generates a PROC operation
  40. ; to start a segment.
  41. ;
  42. ;NOTE: This redefines an existing macro (in either cmicro.mac or dos.mac)
  43. ;      and must come after it in the assembly.
  44.  
  45. BEGIN   MACRO   name            ; begin a function
  46.   IF UNDERLINE
  47.     public  _&name
  48.     IF  LPROG
  49.       _&name    proc   far
  50.     ELSE
  51.       _&name    proc    near
  52.     ENDIF
  53.   ELSE
  54.     public  name
  55.     IF  LPROG
  56.       name    proc    far
  57.     ELSE
  58.       name    proc    near
  59.     ENDIF
  60.   ENDIF
  61. ENDM
  62.  
  63.