1 ;Testname=unoptimized; Arguments=-O0 -fbin -obintest.bin; Files=.stdout .stderr bintest.bin
2 ;Testname=optimized; Arguments=-Ox -fbin -obintest.bin; Files=.stdout .stderr bintest.bin
4 ; test source file for assembling to binary files
6 ; nasm -f bin -o bintest.com bintest.asm
8 ; When run (as a DOS .COM file), this program should print
10 ; on two successive lines, then exit cleanly.
12 ; This file should test the following:
13 ; [1] Define a text-section symbol
14 ; [2] Define a data-section symbol
15 ; [3] Define a BSS-section symbol
16 ; [4] Define a NASM local label
17 ; [5] Reference a NASM local label
18 ; [6] Reference a text-section symbol in the text section
19 ; [7] Reference a data-section symbol in the text section
20 ; [8] Reference a BSS-section symbol in the text section
21 ; [9] Reference a text-section symbol in the data section
22 ; [10] Reference a data-section symbol in the data section
23 ; [11] Reference a BSS-section symbol in the data section
32 endX
mov ax,0x4c00 ; [1]
35 start
mov byte [bss_sym
],',' ; [1] [8]
38 mov bx,[dataptr
] ; [7]
41 .
loop mov dx,datasym
; [1] [4] [7]
47 mov bx,[textptr
] ; [7]
52 datasym
db 'hello world', 13, 10, '$' ; [2]
53 bssptr
dw bss_sym
; [2] [11]
54 dataptr
dw datasym
+5 ; [2] [10]
55 textptr
dw endX
; [2] [9]