2 ; Macro file for MSDOS.
5 SUBTTL
BREAK a listing
into pages
and give new subtitles
12 BREAK <I_NEED
: declare a variable external
, if necessary
, and allocate a size
>
15 ; declare a variable external and allocate a size
18 DATA SEGMENT BYTE PUBLIC 'DATA'
32 ; call a procedure that may be external. The call will be short.
47 ; jump to a label that may be external. The jump will be near.
61 ; get a short address in a word
72 DW OFFSET DOSGROUP
:name
79 ; get a long address in a dword
92 ; declare a PROC near or far but PUBLIC nonetheless
94 procedure
MACRO name
,distance
101 ; define a data item to be public and of an appropriate size/type
123 ; call the macro chain
131 ; define an entry in a procedure
138 BREAK <ERROR
- print a message
and then jump to a
label>
148 BREAK <JUMP
- real jump that links up shortwise
>
150 ; given a label <lbl> either 2 byte jump to another label <lbl>_J
151 ; if it is near enough or 3 byte jump to <lbl>
158 ifndef lbl
&_J
;; is this the first invocation
164 IF ($-lbl
&_J
) GT
126 ;; is the jump too far away?
166 ELSE ;; do the short one...
175 BREAK <RETURN
- return
from a function
>
186 BREAK <CONDRET
- conditional return
>
188 makelab
macro l
,cc
,ncc
193 ret_
&cc
= ret_l
;; define ret_<CC> to be ret_l
198 ifdef ret_l
;; if ret_l is defined
199 if (($ - ret_l
) le
126) and ($ gt ret_l
)
200 ;; if ret_l is near enough then
201 a: j
&cc ret_l
;; a: j<CC> to ret_l
202 ret_
&cc
= a
;; define ret_<CC> to be a:
207 ifdef ret_
&cc
;; if ret_<CC> defined
208 if (($ - ret_
&cc
) le
126) and ($ gt ret_
&cc
)
209 ;; if ret_<CC> is near enough
210 a: j
&cc ret_
&cc
;; a: j<CC> to ret_<CC>
211 ret_
&cc
= a
;; define ret_<CC> to be a:
220 ;condret macro cc,ncc
222 ; ifdef ret_l ; if ret_l is defined
223 ; if (($ - ret_l) le 126) and ($ gt ret_l)
224 ; ; if ret_l is near enough then
225 ; a: j&cc ret_l ; a: j<CC> to ret_l
226 ; ret_&cc = a ; define ret_<CC> to be a:
230 ; ifdef ret_&cc ; if ret_<CC> defined
231 ; if (($ - ret_&cc) le 126) and ($ gt ret_&cc)
232 ; ; if ret_<CC> is near enough
233 ; a: j&cc ret_&cc ; a: j<CC> to ret_<CC>
234 ; ret_&cc = a ; define ret_<CC> to be a:
238 ; j&ncc a ; j<NCC> a:
241 ; ret_&cc = ret_l ; define ret_<CC> to be ret_l
244 BREAK <RETZ
- return
if zero
, links up shortwise
if necessary
>
250 BREAK <RETNZ
- return
if not zero
, links up shortwise
if necessary
>
256 BREAK <RETC
- return
if carry set
, links up shortwise
if necessary
>
262 BREAK <RETNC
- return
if not carry
, links up shortwise
if necessary
>
268 BREAK <CONTEXT
- set the DOS context to a particular register
>