Category : Assembly Language Source Code
Archive   : WDASM18.ZIP
Filename : HILEVEL.INC

 
Output of file : HILEVEL.INC contained in archive : WDASM18.ZIP

.NOLIST

;-----------------------------------------------------------------------
; HILEVEL.INC - Macros for HiLevel 2.1 files.
; Copyright (c) 1993 Eric Grass
;-----------------------------------------------------------------------


IFNB @CurSeg
ECHO HILEVEL.INC should not be included inside a segment declaration.
ENDIF

EXTERNDEF C _aNchkstk:NEAR
EXTERNDEF C _aFchkstk:FAR


;-----------------------------------------------------------------------
; The hCall macro pushes the specified arguments onto the stack
; and calls the specified procedure.
;-----------------------------------------------------------------------

hCall MACRO Args:VARARG
LOCAL firstpass, procname, arg
firstpass = 1
FOR arg,
IF firstpass EQ 0
PUSH arg
ELSE
procname TEXTEQU
firstpass = 0
ENDIF
ENDM
CALL procname
ENDM


;-----------------------------------------------------------------------
; HiLevel Prologue Macros

; The following macros are used to generate prologue and epilogue
; code.
;-----------------------------------------------------------------------



hPrologue MACRO procname, flag, parmbytes, localbytes, reglist, userparms
LOCAL ?DoPrologue, ?LoadDS, ?CheckStack, ?IncBP

?DoPrologue = 0
?LoadDS = 0
?CheckStack = 0
?IncBP = 0
IFNB
FOR par,
IFIDN ,
?LoadDS = 1
ENDIF
IFIDN ,
?LoadDS = 0
ENDIF
IFIDN ,
?CheckStack = 1
ENDIF
IFIDN ,
?CheckStack = 0
ENDIF
IFIDN ,
IF flag AND 20H
?IncBP = 1
ENDIF
ENDIF
IFIDN ,
?IncBP = 0
ENDIF
IFIDN ,
?DoPrologue = 1
ENDIF
ENDM
ENDIF
?DoPrologue = ?DoPrologue OR ?IncBP OR ?LoadDS OR ?CheckStack OR (localbytes NE 0) OR (parmbytes NE 0)
IF ?DoPrologue EQ 0
EXITM <0>
ENDIF
IF ?LoadDS EQ 1
PUSH DS
POP AX
NOP
ENDIF
IF ?IncBP EQ 1
INC BP
ENDIF
PUSH BP
MOV BP, SP
IF ?LoadDS EQ 1
PUSH DS
MOV DS, AX
ENDIF
IF ?CheckStack EQ 1
MOV AX, localbytes
% IFIDN <_TEXT>, <@CurSeg>
CALL _aNchkstk
ELSE
CALL _aFchkstk
ENDIF
ELSE
IF localbytes NE 0
SUB SP, localbytes
ENDIF
ENDIF
IFNB reglist
FOR reg, reglist
PUSH reg
ENDM
ENDIF
EXITM
ENDM


hEpilogue MACRO procname, flag, parmbytes, localbytes, reglist, userparms
LOCAL ?DoEpilogue, ?LoadDS, ?CheckStack, ?IncBP

?DoEpilogue = 0
?LoadDS = 0
?CheckStack = 0
?IncBP = 0
IFNB
FOR par,
IFIDN ,
?LoadDS = 1
ENDIF
IFIDN ,
?LoadDS = 0
ENDIF
IFIDN ,
?CheckStack = 1
ENDIF
IFIDN ,
?CheckStack = 0
ENDIF
IFIDN ,
IF flag AND 20H
?IncBP = 1
ENDIF
ENDIF
IFIDN ,
?IncBP = 0
ENDIF
IFIDN ,
?DoEpilogue = 1
ENDIF
ENDM
ENDIF
?DoEpilogue = ?DoEpilogue OR ?IncBP OR ?LoadDS OR ?CheckStack OR (localbytes NE 0) OR (parmbytes NE 0)
IF ?DoEpilogue EQ 0
RET
EXITM
ENDIF
IFNB reglist
FOR reg, reglist
POP reg
ENDM
ENDIF
IF ?LoadDS
DEC BP
DEC BP
MOV SP, BP
POP DS
POP BP
ELSE
MOV SP,BP
POP BP
ENDIF
IF ?IncBP
DEC BP
ENDIF
IF flag AND 10H
RET
ELSE
IF parmbytes NE 0
RET parmbytes
ELSE
RET
ENDIF
ENDIF
ENDM

.LIST


  3 Responses to “Category : Assembly Language Source Code
Archive   : WDASM18.ZIP
Filename : HILEVEL.INC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/