.xlist ; prologue.h - Macro Header for Microsoft C v3.0,4.0 & 5.x, ASM files. ; ; Copyright (C) 1984-1989 Greenleaf Software Inc. All rights reserved. ; ; Include this with all assembler modules, preceded by the proper ; version of MODEL.H to select the compiler and memory model. ; ; Modified 7/22/85 DK to add leading underscore char to names ; Modified 7/24/85 DN to add leading underscore char to alias label ; ;; David Nienhiser 11-JUN-1986 16:17:46.80 ; Modified for Microsoft C 4.0, compact and huge memory models. ;; David Nienhiser 14-JUL-1986 16:58:23.77 ; Added DefineVar and ReferVar macros & added LABEL option to ; ?cproc macro. ;; David Nienhiser 28-MAY-1987 10:06:18.71 ; Added GetDsAx macro. .xcref mesg,?cproc,?moderr .cref mesg macro txt if1 %out txt endif endm ?moderr = 0 ifndef _MSC3 ifdef _MSC _MSC3 equ 0 endif endif ifndef _MSC ifdef _MSC3 _MSC equ 3 else ?moderr = 1 endif else if (_MSC ne 3) and (_MSC ne 4) and (_MSC ne 5) ?moderr = 1 endif endif ifndef _HUGE _HUGE equ 0 endif if _HUGE eq 1 if (_LCODE ne 1) or (_LDATA ne 1) mesg ?moderr = 1 endif endif if ?moderr eq 0 mesg if _MSC eq 3 mesg endif if (_MSC eq 4) or (_MSC eq 5) mesg endif mesg if (_LCODE eq 0) and (_LDATA eq 0) and (_HUGE eq 0);;Small Model mesg endif if (_LCODE eq 0) and (_LDATA ne 0) and (_HUGE eq 0);; mesg endif if (_LCODE ne 0) and (_LDATA eq 0) and (_HUGE eq 0);;Medium Model mesg endif if (_LCODE ne 0) and (_LDATA ne 0) and (_HUGE eq 0);;Large Model mesg endif if (_LCODE ne 0) and (_LDATA ne 0) and (_HUGE ne 0);;Huge Model mesg endif ; Argument Base address on stack: ; if _LCODE @ab equ 6 ; arg offset if far call parm1_ equ [bp+6] parm2_ equ [bp+8] parm3_ equ [bp+10] parm4_ equ [bp+12] parm5_ equ [bp+14] parm6_ equ [bp+16] parm7_ equ [bp+18] parm8_ equ [bp+20] parm9_ equ [bp+22] parm10_ equ [bp+24] parm11_ equ [bp+26] parm12_ equ [bp+28] parm14_ equ [bp+30] else @ab equ 4 ; ..if near call parm1_ equ [bp+4] parm2_ equ [bp+6] parm3_ equ [bp+8] parm4_ equ [bp+10] parm5_ equ [bp+12] parm6_ equ [bp+14] parm7_ equ [bp+16] parm8_ equ [bp+18] parm9_ equ [bp+20] parm10_ equ [bp+22] parm11_ equ [bp+24] parm12_ equ [bp+26] parm13_ equ [bp+28] parm14_ equ [bp+30] endif if _LDATA ptrsize equ 2 ; Number of words in pointer else ptrsize equ 1 endif ; The DSEG and PSEG macros are defined to generate the appropriate GROUP ; and SEGMENT statements for the compiler and memory model in use. ; In addition, ENDDS and ENDPS are used to end these segments. ; pseg macro segname ifb mesg error endif if (_LCODE eq 0) ;; Small Model Program Segment _TEXT segment byte public 'CODE' assume cs:_TEXT endps ¯o _TEXT ends purge endps &endm endif if (_LCODE ne 0) ;; Medium or Large model segname&_TEXT segment byte public 'CODE' assume cs:&segname&_TEXT endps ¯o segname&_TEXT ends purge endps &endm endif endm ;;pseg dseg macro DGROUP group _DATA _DATA segment word public 'DATA' assume ds:DGROUP endds ¯o _DATA ends purge endds &endm endm GetDsAx macro mov ax,DGROUP endm cproc macro name1,name2,name1s,name2s,storage,options ?N1L = 0 ?N2L = 0 ifb error label not specified endif irpc ?x,name1 ?N1L = ?N1L + 1 endm if ?N1L gt 8 ifb error short name for name1 not specified else ??NS = 0 irpc ?x,name1s ??NS = ??NS + 1 endm if ??NS gt 8 error name1s too long endif endif endif ifnb irpc ?x,name2 ?N2L = ?N2L + 1 endm if ?N2L gt 8 ifb error short name for name2 not specified else ??NS = 0 irpc ?x,name2s ??NS = ??NS + 1 endm if ??NS gt 8 error name2s too long endif endif endif endif ?cproc ,,storage, endm ;; cproc ?cproc macro name1,name2,storage,options public _&name1 ifnb public _&name2 endif if _LCODE _&name1 proc far ifnb _&name2 label far endif else _&name1 proc near ifnb _&name2 label near endif endif ;;_LCODE ??LRA = 0 ??SDS = 0 ;; Save ds? ??SES = 0 ;; Save es? ??SSI = 1 ;; Default for push si ??SDI = 1 ;; Default for push di ??EXIT = 0 ;; exit point wanted? ??EREXIT = 0 ;; error exit point ??OKEXIT = 0 ;; OK Exit point ifnb irp x, ifidn ,