phash.ph: yet another attempt at getting Perl to behave, arithmetically
[nasm/avx512.git] / test / elif.asm
blob057ce5f3c0a37f72cf0a73dc806c03be99a5f232
1 %macro DosPrintMsg 1+
2 %ifnid %1
3 section .data
4 %%str_to_print:db %1
5 section .text
6 mov dx,%%str_to_print
7 mov ah,9
8 int 0x21
9 %else
10 mov dx,(%1)
11 mov ah,9
12 int 0x21
13 %endif
14 %endmacro
16 %macro DosExit 1
17 %if (%1) == 0
18 ;use short-form return 0 exit
19 int 0x20
20 %elif ((%1) < 256) && ((%1) > 0)
21 mov ax,0x4C00 | (%1)
22 int 0x21
23 %else
24 %error Invalid return value
25 %endif
26 %endmacro
28 org 0x100
29 DosPrintMsg predefined_str
30 DosPrintMsg "Using string with macro-defined label",10,0
31 DosExit 0
32 DosExit 1
33 DosExit 256
35 section .data
36 predefined_str:db "Using string with predefined label",10,0