home *** CD-ROM | disk | FTP | other *** search
- ; Program to accompany Michael Abrash's code. Code submitted to make
- ; a point illustrating a letter to Michael
- ; Listing 4.
- ; Copyright by John Navas.
- cseg SEGMENT
- ASSUME cs:cseg
- mproc MACRO ; for local names
- LOCAL locs,field1,field2,loc1,loc
- locs STRUC ; local storage on stack
- field1 DW ?
- field2 DW ?
- locs ENDS
- loc1 EQU SIZE locs + 1 AND -2 ; even length
- loc EQU [bp-loc1] ; negative offset from bp
- sub PROC
- push bp ; save old bp
- mov bp,sp ; setup new bp
- sub sp,loc1 ; allocate local storage
- mov loc[field1],1 ; access local storage
- mov loc[field2],2
- mov sp,bp ; deallocate storage
- pop bp ; restore old bp
- ret ; return to caller
- sub ENDP
- ENDM ; mproc may be reused
- mproc ; expand local names
- DB 2000h - ( $ - cseg ) DUP( 0 )
- call sub ; forced by DB to 2000h
- cseg ENDS
- END
-