Rev 1151 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ; Listing generator |
2 | ; LocoDelAssembly 2007.06.01 |
||
3 | |||
4 | INSTRUCTIONS equ bt in ja jb jc je jg jl jo jp js jz or \ |
||
5 | aaa aad aam aas adc add and bsf bsr btc btr bts cbw cdq clc \ |
||
6 | cld cli cmc cmp cqo cwd daa das dec div fld fst hlt inc ins \ |
||
7 | int jae jbe jge jle jmp jna jnb jnc jne jng jnl jno jnp jns \ |
||
8 | jnz jpe jpo lar lds lea les lfs lgs lsl lss ltr mov mul neg \ |
||
9 | nop not out pop por rcl rcr ret rol ror rsm sal sar sbb shl \ |
||
10 | shr stc std sti str sub ud2 xor \ |
||
11 | arpl call cdqe clgi clts cmps cwde emms fabs fadd fbld fchs \ |
||
12 | fcom fcos fdiv feni fild fist fld1 fldz fmul fnop fsin fstp \ |
||
13 | fsub ftst fxam fxch idiv imul insb insd insw int1 int3 into \ |
||
14 | invd iret jcxz jnae jnbe jnge jnle lahf lgdt lidt lldt lmsw \ |
||
15 | lods loop movd movq movs orpd orps outs pand popa popd popf \ |
||
16 | popq popw push pxor retd retf retn retq retw sahf salc scas \ |
||
17 | seta setb setc sete setg setl seto setp sets setz sgdt shld \ |
||
18 | shrd sidt sldt smsw stgi stos test verr verw wait xadd xchg \ |
||
19 | xlat \ |
||
20 | addpd addps addsd addss andpd andps bound bswap cmova cmovb \ |
||
21 | cmovc cmove cmovg cmovl cmovo cmovp cmovs cmovz cmppd cmpps \ |
||
22 | cmpsb cmpsd cmpsq cmpss cmpsw cpuid divpd divps divsd divss \ |
||
23 | enter f2xm1 faddp fbstp fclex fcomi fcomp fdisi fdivp fdivr \ |
||
24 | femms ffree fiadd ficom fidiv fimul finit fistp fisub fldcw \ |
||
25 | fldpi fmulp fneni fprem fptan fsave fsqrt fstcw fstsw fsubp \ |
||
26 | fsubr fucom fwait fyl2x icebp iretd iretq iretw jecxz jrcxz \ |
||
27 | lddqu leave lodsb lodsd lodsq lodsw loopd loope loopq loopw \ |
||
28 | loopz maxpd maxps maxsd maxss minpd minps minsd minss movsb \ |
||
29 | movsd movsq movss movsw movsx movzx mulpd mulps mulsd mulss \ |
||
30 | mwait outsb outsd outsw pabsb pabsd pabsw paddb paddd paddq \ |
||
31 | paddw pandn pause pavgb pavgw pf2id pf2iw pfacc pfadd pfmax \ |
||
32 | pfmin pfmul pfrcp pfsub pi2fd pi2fw popad popaw popfd popfq \ |
||
33 | popfw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb \ |
||
34 | psubd psubq psubw pusha pushd pushf pushq pushw rcpps rcpss \ |
||
35 | rdmsr rdpmc rdtsc retfd retfq retfw retnd retnq retnw scasb \ |
||
36 | scasd scasq scasw setae setbe setge setle setna setnb setnc \ |
||
37 | setne setng setnl setno setnp setns setnz setpe setpo stosb \ |
||
38 | stosd stosq stosw subpd subps subsd subss vmrun vmxon wrmsr \ |
||
39 | xlatb xorpd xorps \ |
||
40 | andnpd andnps cmovae cmovbe cmovge cmovle cmovna cmovnb cmovnc\ |
||
41 | cmovne cmovng cmovnl cmovno cmovnp cmovns cmovnz cmovpe cmovpo\ |
||
42 | comisd comiss fcmovb fcmove fcmovu fcomip fcompp fdivrp ffreep\ |
||
43 | ficomp fidivr fisttp fisubr fldenv fldl2e fldl2t fldlg2 fldln2\ |
||
44 | fnclex fndisi fninit fnsave fnstcw fnstsw fpatan fprem1 frstor\ |
||
45 | frstpm fscale fsetpm fstenv fsubrp fucomi fucomp fxsave haddpd\ |
||
46 | haddps hsubpd hsubps invlpg lfence looped loopeq loopew loopne\ |
||
47 | loopnz loopzd loopzq loopzw mfence movapd movaps movdqa movdqu\ |
||
48 | movhpd movhps movlpd movlps movnti movntq movsxd movupd movups\ |
||
49 | paddsb paddsw pextrw pfnacc pfsubr phaddd phaddw phsubd phsubw\ |
||
50 | pinsrw pmaxsw pmaxub pminsw pminub pmulhw pmullw psadbw pshufb\ |
||
51 | pshufd pshufw psignb psignd psignw pslldq psrldq psubsb psubsw\ |
||
52 | pswapd pushad pushaw pushfd pushfq pushfw rdmsrq rdtscp setalc\ |
||
53 | setnae setnbe setnge setnle sfence shufpd shufps skinit sqrtpd\ |
||
54 | sqrtps sqrtsd sqrtss swapgs sysret vmcall vmload vmread vmsave\ |
||
55 | vmxoff wbinvd wrmsrq \ |
||
56 | clflush cmovnae cmovnbe cmovnge cmovnle cmpeqpd cmpeqps \ |
||
57 | cmpeqsd cmpeqss cmplepd cmpleps cmplesd cmpless cmpltpd \ |
||
58 | cmpltps cmpltsd cmpltss cmpxchg fcmovbe fcmovnb fcmovne \ |
||
59 | fcmovnu fdecstp fincstp fnstenv frndint fsincos fucomip \ |
||
60 | fucompp fxrstor fxtract fyl2xp1 invlpga ldmxcsr loopned \ |
||
61 | loopneq loopnew loopnzd loopnzq loopnzw monitor movddup \ |
||
62 | movdq2q movhlps movlhps movntdq movntpd movntps movq2dq \ |
||
63 | paddusb paddusw palignr pavgusb pcmpeqb pcmpeqd pcmpeqw \ |
||
64 | pcmpgtb pcmpgtd pcmpgtw pfcmpeq pfcmpge pfcmpgt pfpnacc \ |
||
65 | pfrsqrt phaddsw phsubsw pmaddwd pmulhrw pmulhuw pmuludq \ |
||
66 | pshufhw pshuflw psubusb psubusw rsqrtps rsqrtss stmxcsr \ |
||
67 | syscall sysexit sysretq ucomisd ucomiss vmclear vmmcall \ |
||
68 | vmptrld vmptrst vmwrite \ |
||
69 | addsubpd addsubps cmpneqpd cmpneqps cmpneqsd cmpneqss cmpnlepd\ |
||
70 | cmpnleps cmpnlesd cmpnless cmpnltpd cmpnltps cmpnltsd cmpnltss\ |
||
71 | cmpordpd cmpordps cmpordsd cmpordss cvtdq2pd cvtdq2ps cvtpd2dq\ |
||
72 | cvtpd2pi cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi\ |
||
73 | cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss cvtss2sd cvtss2si fcmovnbe\ |
||
74 | maskmovq movmskpd movmskps movshdup movsldup packssdw packsswb\ |
||
75 | packuswb pfrcpit1 pfrcpit2 pfrsqit1 pmovmskb pmulhrsw prefetch\ |
||
76 | sysenter sysexitq unpckhpd unpckhps unpcklpd unpcklps vmlaunch\ |
||
77 | vmresume \ |
||
78 | cmpxchg8b cvttpd2dq cvttpd2pi cvttps2dq cvttps2pi cvttsd2si \ |
||
79 | cvttss2si pmaddubsw prefetchw punpckhbw punpckhdq punpckhwd \ |
||
80 | punpcklbw punpckldq punpcklwd \ |
||
81 | cmpunordpd cmpunordps cmpunordsd cmpunordss cmpxchg16b \ |
||
82 | loadall286 loadall386 maskmovdqu prefetcht0 prefetcht1 \ |
||
83 | prefetcht2 punpckhqdq punpcklqdq prefetchnta |
||
84 | |||
85 | PREFIXES equ rep lock repe repz repne repnz |
||
86 | |||
87 | DATA_DEFINITORS equ db dw du dd dp df dq dt file |
||
88 | DATA_RESERVERS equ rb rw rd rp rf rq rt |
||
89 | |||
90 | CRLF equ 13, 10 ; Remove 13 for Linux |
||
91 | MAX_BYTES equ 13 |
||
92 | |||
93 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
94 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MODE MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
95 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
96 | macro use16 |
||
97 | { |
||
98 | use16 |
||
99 | _USE = 16 |
||
100 | } |
||
101 | |||
102 | macro use32 |
||
103 | { |
||
104 | use32 |
||
105 | _USE = 32 |
||
106 | } |
||
107 | |||
108 | macro use64 |
||
109 | { |
||
110 | use64 |
||
111 | _USE = 64 |
||
112 | } |
||
113 | |||
114 | macro detect_mode |
||
115 | { |
||
116 | local aux |
||
117 | |||
118 | _USE = 32 |
||
119 | |||
120 | virtual at 0 |
||
121 | xchg eax, eax |
||
122 | load aux byte from 0 |
||
123 | |||
124 | if aux = $66 |
||
125 | _USE = 16 |
||
126 | else if aux = $87 |
||
127 | _USE = 64 |
||
128 | end if |
||
129 | end virtual |
||
130 | } |
||
131 | |||
132 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
133 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; DISPLAYING MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
134 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
135 | |||
136 | macro display_address address* |
||
137 | { |
||
138 | local aux, digit |
||
139 | |||
140 | aux = address |
||
141 | |||
142 | repeat _USE / 4 |
||
143 | digit = aux shr (_USE - 4 * %) and $F |
||
144 | |||
145 | display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F |
||
146 | end repeat |
||
147 | |||
148 | display ': ' |
||
149 | } |
||
150 | |||
151 | macro display_bytes pointer |
||
152 | { |
||
153 | local aux, size, digit |
||
154 | |||
155 | size = $ - pointer |
||
156 | |||
157 | if size > MAX_BYTES |
||
158 | size = MAX_BYTES |
||
159 | end if |
||
160 | |||
161 | repeat size |
||
162 | load aux byte from pointer+%-1 |
||
163 | |||
164 | digit = aux shr 4 |
||
165 | display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F |
||
166 | |||
167 | digit = aux and $F |
||
168 | display digit + '0' + ('9' - 'B') and (9 - digit) shr 4 and $F |
||
169 | |||
170 | |||
171 | display ' ' |
||
172 | end repeat |
||
173 | |||
174 | repeat MAX_BYTES - size |
||
175 | display ' ' |
||
176 | end repeat |
||
177 | } |
||
178 | |||
179 | ; The macro below in some situations doesn't adds a space to separate things unfortunatelly, so for readability ensurance |
||
180 | ; another one will be used instead... |
||
181 | ;macro display_args [args] |
||
182 | ;{ |
||
183 | ;common |
||
184 | ; aux = 1 |
||
185 | ; |
||
186 | ;forward |
||
187 | ; if ~args eq |
||
188 | ; if aux |
||
189 | ; display ' ' |
||
190 | ; else |
||
191 | ; display ', ' |
||
192 | ; end if |
||
193 | ; |
||
194 | ; aux = 0 |
||
195 | ; |
||
196 | ; match =ON, _RESOLVE_EQUATES |
||
197 | ; \{ |
||
198 | ; match args, args |
||
199 | ; \\{ |
||
200 | ; irps arg, args |
||
201 | ; \\\{ |
||
202 | ; display \\\`arg |
||
203 | ; \\\} |
||
204 | ; \\} |
||
205 | ; \} |
||
206 | ; match =OFF, _RESOLVE_EQUATES |
||
207 | ; \{ |
||
208 | ; irps arg, args |
||
209 | ; \\{ |
||
210 | ; display \\`arg |
||
211 | ; \\} |
||
212 | ; |
||
213 | ; \} |
||
214 | ; end if |
||
215 | ;} |
||
216 | |||
217 | ; This one separates everything with one space. A very ugly listing but at least you will not see things |
||
218 | ; like "push ebxesiedi" nor "ret word0" |
||
219 | |||
220 | macro display_args [args] |
||
221 | { |
||
222 | common |
||
223 | aux = 1 |
||
224 | |||
225 | forward |
||
226 | if ~args eq |
||
227 | if ~aux |
||
228 | display ',' |
||
229 | end if |
||
230 | |||
231 | aux = 0 |
||
232 | |||
233 | match =ON, _RESOLVE_EQUATES |
||
234 | \{ |
||
235 | match args, args |
||
236 | \\{ |
||
237 | if ~args eqtype "" |
||
238 | irps arg, args |
||
239 | \\\{ |
||
240 | display ' ', \\\`arg |
||
241 | \\\} |
||
242 | else |
||
243 | display " '", args, "'" |
||
244 | end if |
||
245 | \\} |
||
246 | \} |
||
247 | match =OFF, _RESOLVE_EQUATES |
||
248 | \{ |
||
249 | if ~args eqtype "" |
||
250 | irps arg, args |
||
251 | \\{ |
||
252 | display ' ', \\`arg |
||
253 | \\} |
||
254 | else |
||
255 | display " '", args, "'" |
||
256 | end if |
||
257 | \} |
||
258 | end if |
||
259 | } |
||
260 | |||
261 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
262 | ;;;;;;;;;;;;;;;;;;;;;;; INSTRUCTIONS & PREFIXES MACROSES ;;;;;;;;;;;;;;;;;;;;;;; |
||
263 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
264 | |||
265 | macro prefix mnemonic |
||
266 | { |
||
267 | local aux |
||
268 | |||
269 | macro mnemonic [args] |
||
270 | \{ |
||
271 | \common |
||
272 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
273 | match =equ, args\\{_LISTING equ 0\\} |
||
274 | match =equ any, args\\{_LISTING equ 0\\} |
||
275 | |||
276 | match =1, _LISTING |
||
277 | \\{ |
||
278 | display_address $ |
||
279 | aux = $ |
||
280 | \\} |
||
281 | |||
282 | mnemonic |
||
283 | |||
284 | match =1, _LISTING |
||
285 | \\{ |
||
286 | display_bytes aux |
||
287 | |||
288 | display \`mnemonic |
||
289 | display CRLF |
||
290 | \\} |
||
291 | |||
292 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
293 | match =equ, args\\{restore _LISTING\\} |
||
294 | match =equ any, args\\{restore _LISTING\\} |
||
295 | |||
296 | def_prefix mnemonic |
||
297 | args |
||
298 | purge mnemonic |
||
299 | \} |
||
300 | } |
||
301 | |||
302 | macro def_prefix mnemonic |
||
303 | { |
||
304 | macro def_prefix mnemonic |
||
305 | \{ |
||
306 | prefix mnemonic |
||
307 | \} |
||
308 | def_prefix mnemonic |
||
309 | } |
||
310 | |||
311 | macro instruction mnemonic |
||
312 | { |
||
313 | local aux |
||
314 | |||
315 | macro mnemonic [args] |
||
316 | \{ |
||
317 | \common |
||
318 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
319 | match =equ, args\\{_LISTING equ 0\\} |
||
320 | match =equ any, args\\{_LISTING equ 0\\} |
||
321 | |||
322 | match =1, _LISTING |
||
323 | \\{ |
||
324 | display_address $ |
||
325 | aux = $ |
||
326 | \\} |
||
327 | |||
328 | mnemonic args |
||
329 | |||
330 | match =1, _LISTING |
||
331 | \\{ |
||
332 | display_bytes aux |
||
333 | |||
334 | display \`mnemonic |
||
335 | |||
336 | virtual at 0 |
||
337 | db \`mnemonic |
||
338 | repeat 11 - $ |
||
339 | display ' ' |
||
340 | end repeat |
||
341 | end virtual |
||
342 | |||
343 | display_args args |
||
344 | display CRLF |
||
345 | \\} |
||
346 | |||
347 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
348 | match =equ, args\\{restore _LISTING\\} |
||
349 | match =equ any, args\\{restore _LISTING\\} |
||
350 | \} |
||
351 | } |
||
352 | |||
353 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
354 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATA MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
355 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
356 | |||
357 | macro data_define mnemonic |
||
358 | { |
||
359 | local aux |
||
360 | macro mnemonic [args] |
||
361 | \{ |
||
362 | \common |
||
363 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
364 | match =equ, args\\{_LISTING equ 0\\} |
||
365 | match =equ any, args\\{_LISTING equ 0\\} |
||
366 | |||
367 | match =1, _LISTING |
||
368 | \\{ |
||
369 | display_address $ |
||
370 | aux = $ |
||
371 | \\} |
||
372 | |||
373 | mnemonic args |
||
374 | |||
375 | match =1, _LISTING |
||
376 | \\{ |
||
377 | display_bytes aux |
||
378 | |||
379 | display \`mnemonic |
||
380 | |||
381 | display_args args |
||
382 | display CRLF |
||
383 | |||
384 | aux = aux + MAX_BYTES |
||
385 | |||
386 | repeat ($ - aux + MAX_BYTES - 1) / MAX_BYTES |
||
387 | display_address aux |
||
388 | display_bytes aux |
||
389 | display CRLF |
||
390 | |||
391 | aux = aux + MAX_BYTES |
||
392 | end repeat |
||
393 | \\} |
||
394 | |||
395 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
396 | match =equ, args\\{restore _LISTING\\} |
||
397 | match =equ any, args\\{restore _LISTING\\} |
||
398 | \} |
||
399 | |||
400 | struc mnemonic [args] |
||
401 | \{ |
||
402 | \common |
||
403 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
404 | match =equ, args\\{_LISTING equ 0\\} |
||
405 | match =equ any, args\\{_LISTING equ 0\\} |
||
406 | |||
407 | match =1, _LISTING |
||
408 | \\{ |
||
409 | display_address $ |
||
410 | aux = $ |
||
411 | \\} |
||
412 | |||
413 | . mnemonic args |
||
414 | |||
415 | match =1, _LISTING |
||
416 | \\{ |
||
417 | display_bytes aux |
||
418 | |||
419 | display \`., ' ', \`mnemonic |
||
420 | |||
421 | display_args args |
||
422 | display CRLF |
||
423 | |||
424 | aux = aux + MAX_BYTES |
||
425 | |||
426 | repeat ($ - aux + MAX_BYTES - 1) / MAX_BYTES |
||
427 | display_address aux |
||
428 | display_bytes aux |
||
429 | display CRLF |
||
430 | |||
431 | aux = aux + MAX_BYTES |
||
432 | end repeat |
||
433 | \\} |
||
434 | |||
435 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
436 | match =equ, args\\{restore _LISTING\\} |
||
437 | match =equ any, args\\{restore _LISTING\\} |
||
438 | \} |
||
439 | } |
||
440 | |||
441 | macro data_reserve mnemonic |
||
442 | { |
||
443 | local aux |
||
444 | macro mnemonic [args] |
||
445 | \{ |
||
446 | \common |
||
447 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
448 | match =equ, args\\{_LISTING equ 0\\} |
||
449 | match =equ any, args\\{_LISTING equ 0\\} |
||
450 | |||
451 | match =1, _LISTING |
||
452 | \\{ |
||
453 | display_address $ |
||
454 | aux = $ |
||
455 | \\} |
||
456 | |||
457 | mnemonic args |
||
458 | |||
459 | match =1, _LISTING |
||
460 | \\{ |
||
461 | times MAX_BYTES display ' ' |
||
462 | |||
463 | display \`mnemonic |
||
464 | |||
465 | display_args args |
||
466 | display CRLF |
||
467 | \\} |
||
468 | |||
469 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
470 | match =equ, args\\{restore _LISTING\\} |
||
471 | match =equ any, args\\{restore _LISTING\\} |
||
472 | \} |
||
473 | |||
474 | struc mnemonic [args] |
||
475 | \{ |
||
476 | \common |
||
477 | match =1, _ON_VIRTUAL\\{_LISTING equ 0\\} |
||
478 | match =equ, args\\{_LISTING equ 0\\} |
||
479 | match =equ any, args\\{_LISTING equ 0\\} |
||
480 | |||
481 | match =1, _LISTING |
||
482 | \\{ |
||
483 | display_address $ |
||
484 | aux = $ |
||
485 | \\} |
||
486 | |||
487 | . mnemonic args |
||
488 | |||
489 | match =1, _LISTING |
||
490 | \\{ |
||
491 | times MAX_BYTES display ' ' |
||
492 | |||
493 | display \`., ' ', \`mnemonic |
||
494 | |||
495 | display_args args |
||
496 | display CRLF |
||
497 | \\} |
||
498 | |||
499 | match =1, _ON_VIRTUAL\\{restore _LISTING\\} |
||
500 | match =equ, args\\{restore _LISTING\\} |
||
501 | match =equ any, args\\{restore _LISTING\\} |
||
502 | \} |
||
503 | } |
||
504 | |||
505 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
506 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;; LISTING CONTROL MACROSES ;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
507 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
508 | |||
509 | macro virtual [args] |
||
510 | { |
||
511 | common |
||
512 | _ON_VIRTUAL equ 1 |
||
513 | |||
514 | virtual args |
||
515 | } |
||
516 | |||
517 | macro end [args] |
||
518 | { |
||
519 | common |
||
520 | match =virtual, args\{restore _ON_VIRTUAL\} |
||
521 | |||
522 | end args |
||
523 | } |
||
524 | |||
525 | macro enable_listing |
||
526 | { |
||
527 | detect_mode |
||
528 | |||
529 | match =0, _MACROSES_INSTALLED |
||
530 | \{ |
||
531 | match instructions, INSTRUCTIONS |
||
532 | \\{ |
||
533 | irps ins, instructions |
||
534 | \\\{ |
||
535 | instruction ins |
||
536 | \\\} |
||
537 | \\} |
||
538 | |||
539 | match prefixes, PREFIXES |
||
540 | \\{ |
||
541 | irps prefix, prefixes |
||
542 | \\\{ |
||
543 | def_prefix prefix |
||
544 | \\\} |
||
545 | \\} |
||
546 | |||
547 | match data_definitors, DATA_DEFINITORS |
||
548 | \\{ |
||
549 | irps def, data_definitors |
||
550 | \\\{ |
||
551 | data_define def |
||
552 | \\\} |
||
553 | \\} |
||
554 | |||
555 | match data_reservers, DATA_RESERVERS |
||
556 | \\{ |
||
557 | irps def, data_reservers |
||
558 | \\\{ |
||
559 | data_reserve def |
||
560 | \\\} |
||
561 | \\} |
||
562 | \} |
||
563 | |||
564 | _MACROSES_INSTALLED equ 1 |
||
565 | _LISTING equ 1 |
||
566 | } |
||
567 | |||
568 | macro disable_listing |
||
569 | { |
||
570 | _LISTING equ 0 |
||
571 | } |
||
572 | |||
573 | macro enable [feature*] |
||
574 | { |
||
575 | forward |
||
576 | UNKNOWN equ 1 |
||
577 | |||
578 | match =resolve_equates, feature |
||
579 | \{ |
||
580 | restore _RESOLVE_EQUATES |
||
581 | _RESOLVE_EQUATES equ ON |
||
582 | UNKNOWN equ 0 |
||
583 | \} |
||
584 | |||
585 | match =listing, feature |
||
586 | \{ |
||
587 | enable_listing |
||
588 | UNKNOWN equ 0 |
||
589 | \} |
||
590 | |||
591 | match =1, UNKNOWN |
||
592 | \{ |
||
593 | display 'ERROR: Unknown "',`feature, '" feature', 13, 10 |
||
594 | err |
||
595 | \} |
||
596 | |||
597 | restore UNKNOWN |
||
598 | restore UNKNOWN |
||
599 | } |
||
600 | |||
601 | macro disable [feature*] |
||
602 | { |
||
603 | UNKNOWN equ 1 |
||
604 | |||
605 | match =resolve_equates, feature |
||
606 | \{ |
||
607 | restore _RESOLVE_EQUATES |
||
608 | _RESOLVE_EQUATES equ OFF |
||
609 | UNKNOWN equ 0 |
||
610 | \} |
||
611 | |||
612 | match =listing, feature |
||
613 | \{ |
||
614 | disable_listing |
||
615 | UNKNOWN equ 0 |
||
616 | \} |
||
617 | |||
618 | match =1, UNKNOWN |
||
619 | \{ |
||
620 | display 'ERROR: Unknown "',`feature, '" feature', 13, 10 |
||
621 | err |
||
622 | \} |
||
623 | |||
624 | restore UNKNOWN |
||
625 | restore UNKNOWN |
||
626 | } |
||
627 | |||
628 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
629 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INITIALIZATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
630 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
631 | |||
632 | _MACROSES_INSTALLED equ 0 |
||
633 | _ON_VIRTUAL equ 0 |
||
634 | |||
635 | disable resolve_equates |