1 ;------------------------------------------------------------
\r
3 ; MODEX.DEF - Include file
\r
4 ; Copyright (c) 1993-1994 by Alessandro Scotti
\r
9 TRUE EQU 1 ; Boolean constants
\r
12 USE286 = FALSE ; TRUE enables 80286 instructions
\r
13 USE386 = FALSE ; TRUE enables 80386 (and 80286) instructions
\r
24 MXVERSION EQU 0128h ; Library version (1.40)
\r
26 ;------------------------------------------------------------
\r
30 MISC EQU 3C2h ; Miscellaneous output
\r
31 TS EQU 3C4h ; Timing Sequencer index register
\r
32 GDC EQU 3CEh ; Graphics Data Controller index register
\r
33 CRTC EQU 3D4h ; CRTC index register
\r
34 STATUS EQU 3DAh ; Input Status register one
\r
36 ;------------------------------------------------------------
\r
41 OP_MOVE EQU 0 ; Same as OP_SET
\r
46 OP_ADD EQU 5 ; Must be last op
\r
48 ;------------------------------------------------------------
\r
50 ; Polygon fill functions
\r
52 POLYSCANBUFSIZE EQU 4*1024
\r
54 ;------------------------------------------------------------
\r
55 ; Macro to push registers, variables or flags onto the stack
\r
56 ; Usage: .push "loc16"[,"loc16"...]
\r
57 ; where "loc16" is a 16-bit register, a word-sized variable or the
\r
59 ; Exmpl: .push ax, flags, var1
\r
60 ; .pop ax, flags, var1
\r
62 .push MACRO r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10
\r
64 .ERROR <.PUSH has more than 10 arguments>
\r
66 IRP $reg, <r0, r1, r2, r3, r4, r5, r6, r7, r8, r9>
\r
67 IFB <$reg> ;; Is argument blank?
\r
69 ELSEIFIDNI <$reg>, <FLAGS> ;; Is argument the keyword "FLAGS"?
\r
70 pushf ;; Yes, push flags
\r
72 push $reg ;; Push argument
\r
77 ;------------------------------------------------------------
\r
78 ; Macro to pop registers, variables or flags from the stack
\r
79 ; Usage: .pop "loc16"[,"loc16"...]
\r
80 ; where "loc16" is a 16-bit register, a word-sized variable or the
\r
82 ; Exmpl: .push ax, flags, var1
\r
83 ; .pop ax, flags, var1
\r
85 .pop MACRO r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10
\r
87 .ERROR <.POP has more than 10 arguments>
\r
89 IRP $reg, <r9, r8, r7, r6, r5, r4, r3, r2, r1, r0>
\r
90 IFNB <$reg> ;; Is argument non-blank?
\r
91 IFIDNI <$reg>, <FLAGS> ;; Yes, is it the keyword "FLAGS"?
\r
92 popf ;; Yes, pop flags
\r
94 pop $reg ;; Pop argument
\r
100 ;------------------------------------------------------------
\r
102 .enter MACRO localsize
\r
112 ;------------------------------------------------------------
\r
114 ;.leave MACRO argsize
\r
115 ; IF USE286 EQ TRUE
\r
128 ;------------------------------------------------------------
\r
130 ;.shr MACRO arg, count
\r
131 ; IF USE286 EQ TRUE
\r
142 ;------------------------------------------------------------
\r
144 ;.shl MACRO arg, count
\r
145 ; IF USE286 EQ TRUE
\r
156 ;------------------------------------------------------------
\r
158 ;.chk386 MACRO name, jump
\r
159 ; IF USE386 EQ FALSE
\r
160 ; .OUT "Warning: ", <name>, " needs a 386 or better to run!"
\r