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
19 DATA SEGMENT BYTE PUBLIC 'DATA'
32 CODE SEGMENT BYTE PUBLIC 'CODE'
36 ; call a procedure that may be external. The call will be short.
47 ; jump to a label that may be external. The call will be near.
57 ; get a short address in a word
64 DW OFFSET DOSGROUP
:name
71 ; get a long address in a dword
81 ; declare a PROC near or far but PUBLIC nonetheless
83 procedure
MACRO name
,distance
90 ; define a data item to be public and of an appropriate size/type
112 ; play games with a possible external. Create a new
113 ; macro for the symbol and text, and string it together
114 ; with a central invoker
132 ; add an external declaration to s with type t if it is not defined
140 def_mac ?
z&%?i
,?
z&%
(?i
-1),s
,t
145 ; define a macro called that possibly externals s:t and then calls macro n
147 def_mac
macro m
,n
,s
,t
165 ; call the macro chain
179 ; define an entry in a procedure
186 BREAK <ERROR
- print a message
and then jump to a
label>
196 BREAK <JUMP
- real jump that links up shortwise
>
198 ; given a label <lbl> either 2 byte jump to another label <lbl>_J
199 ; if it is near enough or 3 byte jump to <lbl>
206 ifndef lbl
&_J
; is this the first invocation
212 IF ($-lbl
&_J
) GT
126 ; is the jump too far away?
214 ELSE ; do the short one...
221 BREAK <RETURN
- return
from a function
>
231 BREAK <CONDRET
- conditional return
>
233 makelab
macro l
,cc
,ncc
237 ret_
&cc
= ret_l
; define ret_<CC> to be ret_l
242 ifdef ret_l
; if ret_l is defined
243 if (($ - ret_l
) le
126) and ($ gt ret_l
)
244 ; if ret_l is near enough then
245 a: j
&cc ret_l
; a: j<CC> to ret_l
246 ret_
&cc
= a
; define ret_<CC> to be a:
251 ifdef ret_
&cc
; if ret_<CC> defined
252 if (($ - ret_
&cc
) le
126) and ($ gt ret_
&cc
)
253 ; if ret_<CC> is near enough
254 a: j
&cc ret_
&cc
; a: j<CC> to ret_<CC>
255 ret_
&cc
= a
; define ret_<CC> to be a:
264 ;condret macro cc,ncc
266 ; ifdef ret_l ; if ret_l is defined
267 ; if (($ - ret_l) le 126) and ($ gt ret_l)
268 ; ; if ret_l is near enough then
269 ; a: j&cc ret_l ; a: j<CC> to ret_l
270 ; ret_&cc = a ; define ret_<CC> to be a:
274 ; ifdef ret_&cc ; if ret_<CC> defined
275 ; if (($ - ret_&cc) le 126) and ($ gt ret_&cc)
276 ; ; if ret_<CC> is near enough
277 ; a: j&cc ret_&cc ; a: j<CC> to ret_<CC>
278 ; ret_&cc = a ; define ret_<CC> to be a:
282 ; j&ncc a ; j<NCC> a:
285 ; ret_&cc = ret_l ; define ret_<CC> to be ret_l
288 BREAK <RETZ
- return
if zero
, links up shortwise
if necessary
>
294 BREAK <RETNZ
- return
if not zero
, links up shortwise
if necessary
>
300 BREAK <RETC
- return
if carry set
, links up shortwise
if necessary
>
306 BREAK <RETNC
- return
if not carry
, links up shortwise
if necessary
>