	.xlist
ifdef ??version
	%out *** MASM 5.1 compatibility mode ***
	masm51
	quirks
	%bin 30
endif
%       title   @filename
	page	60,132
	.xcref
	.sall

; Define Storage
; format:  dss {1,2,4,6,8},name
;	   dss {1-65535}

ds1	equ	<label byte>
ds2	equ	<label word>
ds4	equ	<label dword>
ds6	equ	<label fword>
ds8	equ	<label qword>

dss	macro	nb,nm
    ifnb  <nm>
    ifdef ds&nb
% nm	ds&nb
    else
% nm	label	byte
    endif
    endif
	org	$+nb
	endm


; Define Structure

dstruc	macro	sname,sofst
    ifnb <sofst>
    .errdef <sname>
dssave	=	$
	org	sofst
    else
sname	equ	$
	org	dssave
    endif
	endm


dv	macro	loc,length,value
    ifnb <value>
loc	db	length dup (value)
    else
	db	loc dup (length)
    endif
	endm

da	macro	string,term
	db	"&string"
    ifnb <term>
	db	&term
    endif
	endm

dbl	macro	string
	local	se
	db	(se-$-1),&string
% se:
	endm

dbww	macro	byte1,word1,word2
	db	byte1
	dw	word1,word2
	endm


; Define Memory Model
; format:  setmod {s,c,m,l,h}

mdls	equ	<small>
mdlc	equ	<compact>
mdlm	equ	<medium>
mdll	equ	<large>
mdlh	equ	<huge>
    ifndef mm
mm	equ	<s>
    endif

setmod	macro	mtype
    ifdef mdl&mtype
	.8086
% aa 	equ	<.model mdl&mtype>
%	aa
%	asyn	<mdl&mtype>
pb	equ	(@codesize shl 1)+4
    else
	asyn	<[1m[5merror[0m: '&mtype' undefined>
    endif
	purge	asyn
	purge	setmod
	endm
asyn	macro	msg
    if2
%	%out	*** &msg memory model ***
    endif
	endm


; Directives

os	equ	<offset>
s	equ	<short>
mb	equ	<byte ptr>
mw	equ	<word ptr>
ml	equ	<dword ptr>

	.386P

.eopg	macro
	.list
	page
	endm

.ilist	macro
	.list
	endm
	.cref
