-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros1.inc
336 lines (250 loc) · 6.01 KB
/
macros1.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
_main macro
main proc
mov ax, @data
mov ds, ax
endm
_main_end macro
mov ah, 4ch
int 21h
main endp
endm
_string_inp macro p
mov dx, offset p
mov ah, 3fh
int 21h
endm
_print_string macro p
mov dx, offset p
mov ah, 09h
int 21h
endm
_input macro ; input saved in al
mov ah, 01h
int 21h
endm
_ouput macro o
mov dl, o
mov ah, 02h
int 21h
endm
_ouputX macro o
mov dx, o
mov ah, 02h
int 21h
endm
_ouput_num macro o
mov dl, byte ptr [o]
add dl, 48
mov ah, 02h
int 21h
endm
_input_num_al macro
_input
mov ah, 0
sub ax , 48
endm
;-----------------------------------macros to swap variables (convinient than to mov into vables by typing in registers as temporary stores)
_mov macro a, b
push al
mov al, b
mov a, al
pop al
endm
_movx macro a, b
push ax
mov ax, b
mov a, ax
pop ax
endm
_add macro a, b
push ax
mov ax, a
add ax, b
mov a,ax
pop ax
endm
_move macro a, b
push eax
mov eax, b
mov a, eax
pop eax
endm
;----------------------------------------------------FLAG
draw_flag macro
;----------------------------------------------------FLAG
_change_block 630,5,5,300,1111b ;pole
call drawblock
_change_block 540,5,85,60,14 ;flag
call drawblock
call draw_M
endm
;---------------------------------to reset values in the mario position variables
mario_reset macro
_movx mcol, mstart_col ; 10
_movx mrow, mstart_row ; 295
endm
;------------------------to reset initial values of floor
floor_reset macro
_movx fcol, fstart_col ;0
_movx frow, fstart_row ;301
endm
mk_floor macro
top:cmp varloop,14
jae endloop
add varloop,1
call mk_floor_block
add fstart_col,48
jmp top
endloop:
endm
;------------------------to reset initial values of brick
brick_reset macro
_movx bcol, bstart_col
_movx brow, bstart_row
endm
;------------------------to reset initial values of coin
coin_reset macro
_movx ccol, cstart_col
_movx crow, cstart_row
endm
;------------------------to reset initial values of tunnel
tunnel_reset macro
_movx tcol, tstart_col ; 152
_movx trow, tstart_row ; 252
endm
;===============================================
;===================================================
;======================TUNNEL MACROS ===============
;===================================================
;---------------------------------to reset values of the tunnel position variables
;----------------------make tunnel
mk_tunnel macro length
;---------------------*row 1*
tunnel_reset
_change_block tcol,trow,57,3,0
call drawblock
;---------------------*row 2*
tunnel_reset
add trow,3
_change_block tcol,trow,3,3,0
call drawblock
add tcol,3
_change_block tcol,trow,51,3,10
call drawblock
add tcol,51
_change_block tcol,trow,3,3,0
call drawblock
;---------------------*row 3*
tunnel_reset
add trow,6
_change_block tcol,trow,3,3,0
call drawblock
add tcol,3
_change_block tcol,trow,6,3,2
call drawblock
add tcol,6
_change_block tcol,trow,12,3,10
call drawblock
add tcol,12
_change_block tcol,trow,30,3,2
call drawblock
add tcol,30
_change_block tcol,trow,3,3,10
call drawblock
add tcol,3
_change_block tcol,trow,3,3,0
call drawblock
;---------------------*row 4*
tunnel_reset
add trow,9
_change_block tcol,trow,3,18,0
call drawblock
add tcol,3
_change_block tcol,trow,3,18,10
call drawblock
add tcol,3
_change_block tcol,trow,3,18,2
call drawblock
add tcol,3
_change_block tcol,trow,12,18,10
call drawblock
add tcol,12
_change_block tcol,trow,30,18,2
call drawblock
add tcol,30
_change_block tcol,trow,3,18,10
call drawblock
add tcol,3
_change_block tcol,trow,3,18,0
call drawblock
;---------------------*row 5*
tunnel_reset
add trow,27
_change_block tcol,trow,57,3,0
call drawblock
;---------------------*row 6*
tunnel_reset
add trow,30
add tcol,6
_change_block tcol,trow,45,3,0
call drawblock
;---------------------*row 7*
tunnel_reset
add trow,33
add tcol,6
_change_block tcol,trow,3,length,0
call drawblock
add tcol,3
_change_block tcol,trow,3,length,10
call drawblock
add tcol,3
_change_block tcol,trow,3,length,2
call drawblock
add tcol,3
_change_block tcol,trow,9,length,10
call drawblock
add tcol,9
_change_block tcol,trow,3,length,2
call drawblock
add tcol,3
_change_block tcol,trow,3,length,10
call drawblock
add tcol,3
_change_block tcol,trow,15,length,2
call drawblock
add tcol,15
_change_block tcol,trow,3,length,10
call drawblock
add tcol,3
_change_block tcol,trow,3,length,0
call drawblock
;---------------------------
endm
;===================================================
;======================TUNNEL MACROS END============
;===================================================
;===============================================
;================================ |;================================================================= |
;======---COLOUR SCHEME---======= |;=======================---VIDEO MODES---========================= |
;================================ |;================================================================= |
;Dec Hex Binary Color |Mode (in AL) Display Lines Number of Colors Adapters
;0 0 0000 Black |0 40 x 25 B&W text CGA, EGA, VGA
;1 1 0001 Blue |1 40 x 25 Color text CGA, EGA, VGA
;2 2 0010 Green |2 80 x 25 B&W text CGA, EGA, VGA
;3 3 0011 Cyan |3 80 x 25 Color text CGA, EGA, VGA
;4 4 0100 Red |4 320 x 200 4 CGA, EGA, VGA
;5 5 0101 Magenta |5 320 x 200 B&W CGA, EGA, VGA
;6 6 0110 Brown |6 640 x 200 2 (on or off) CGA, EGA, VGA
;7 7 0111 Light Gray |7 80 x 25 Monochrome MDA, EGA, VGA
;8 8 1000 Dark Gray |8 160 x 200 16 PCjr
;9 9 1001 Light Blue |9 320 x 200 16 PCjr
;10 A 1010 Light Green |A 640 x 200 1 PCjr
;11 B 1011 Light Cyan |B Reserved for future use
;12 C 1100 Light Red |C Reserved for future use
;13 D 1101 Light Magenta |D 320 x 200 16 EGA, VGA
;14 E 1110 Yellow |E 640 x 200 16 EGA, VGA
;15 F 1111 White |F 640 x 350 Monochrome EGA, VGA
; |10H 640 x 350 16 EGA, VGA
; |11H 640 x 480 2 VGA
; |12H 640 x 480 16 VGA
; |13H 320 x 200 256 VGA