home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
MAGAZINE
/
PROGJOUR
/
PJ_5_4.ZIP
/
PJ4-L4.ASM
< prev
Wrap
Assembly Source File
|
1987-10-12
|
896b
|
32 lines
; 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