| 1 |
;Testname=unoptimized; Arguments=-O0 -fobj -oelif.obj; Files=stdout stderr elif.obj |
| 2 |
;Testname=optimized; Arguments=-Ox -fobj -oelif.obj; Files=stdout stderr elif.obj |
| 3 |
|
| 4 |
%macro DosPrintMsg 1+ |
| 5 |
%ifnid %1 |
| 6 |
section .data |
| 7 |
%%str_to_print:db %1 |
| 8 |
section .text |
| 9 |
mov dx,%%str_to_print |
| 10 |
mov ah,9 |
| 11 |
int 0x21 |
| 12 |
%else |
| 13 |
mov dx,(%1) |
| 14 |
mov ah,9 |
| 15 |
int 0x21 |
| 16 |
%endif |
| 17 |
%endmacro |
| 18 |
|
| 19 |
%macro DosExit 1 |
| 20 |
%if (%1) == 0 |
| 21 |
;use short-form return 0 exit |
| 22 |
int 0x20 |
| 23 |
%elif ((%1) < 256) && ((%1) > 0) |
| 24 |
mov ax,0x4C00 | (%1) |
| 25 |
int 0x21 |
| 26 |
%else |
| 27 |
%error Invalid return value |
| 28 |
%endif |
| 29 |
%endmacro |
| 30 |
|
| 31 |
org 0x100 |
| 32 |
DosPrintMsg predefined_str |
| 33 |
DosPrintMsg "Using string with macro-defined label",10,0 |
| 34 |
DosExit 0 |
| 35 |
DosExit 1 |
| 36 |
DosExit 256 |
| 37 |
|
| 38 |
section .data |
| 39 |
predefined_str:db "Using string with predefined label",10,0 |