diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:52:08 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 20:52:08 +0000 |
commit | d7ed89eac9580f280fe0017b22c8e38ca75ed8e3 (patch) | |
tree | 98c4fcdd286b44e14f79aa65271e5caa1c2c7be4 /test | |
parent | ea8382740dbe5e1607742d0a7c7c139dffcc5ae5 (diff) | |
download | nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.tar.gz nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.tar.bz2 nasm-d7ed89eac9580f280fe0017b22c8e38ca75ed8e3.zip |
NASM 0.94
Diffstat (limited to 'test')
-rw-r--r-- | test/aouttest.asm | 26 | ||||
-rw-r--r-- | test/bintest.asm | 10 | ||||
-rw-r--r-- | test/cofftest.asm | 24 | ||||
-rw-r--r-- | test/elftest.asm | 24 | ||||
-rw-r--r-- | test/inc1.asm | 2 | ||||
-rw-r--r-- | test/inctest.asm | 8 | ||||
-rw-r--r-- | test/objtest.asm | 26 |
7 files changed, 60 insertions, 60 deletions
diff --git a/test/aouttest.asm b/test/aouttest.asm index c52f112..a11824f 100644 --- a/test/aouttest.asm +++ b/test/aouttest.asm @@ -23,17 +23,17 @@ ; [16] Reference a data-section symbol in the data section ; [17] Reference a BSS-section symbol in the data section -[BITS 32] -[GLOBAL _lrotate] ; [1] -[GLOBAL _greet] ; [1] -[GLOBAL _asmstr] ; [2] -[GLOBAL _textptr] ; [2] -[GLOBAL _selfptr] ; [2] -[GLOBAL _integer] ; [3] -[EXTERN _printf] ; [10] -[COMMON _commvar 4] ; [7] + BITS 32 + GLOBAL _lrotate ; [1] + GLOBAL _greet ; [1] + GLOBAL _asmstr ; [2] + GLOBAL _textptr ; [2] + GLOBAL _selfptr ; [2] + GLOBAL _integer ; [3] + EXTERN _printf ; [10] + COMMON _commvar 4 ; [7] -[SECTION .text] + SECTION .text ; prototype: long lrotate(long x, int num); _lrotate: ; [1] @@ -53,14 +53,14 @@ _greet mov eax,[_integer] ; [14] mov [localint],eax ; [14] push dword [_commvar] mov eax,[localptr] ; [13] - push dword [eax] ; + push dword [eax] push dword [_integer] ; [1] [14] push dword _printfstr ; [13] call _printf ; [11] add esp,16 ret -[SECTION .data] + SECTION .data ; a string _asmstr db 'hello, world', 0 ; [2] @@ -74,7 +74,7 @@ localptr dd localint ; [5] [17] _textptr dd _greet ; [15] _selfptr dd _selfptr ; [16] -[SECTION .bss] + SECTION .bss ; an integer _integer resd 1 ; [3] diff --git a/test/bintest.asm b/test/bintest.asm index 0a3c4ae..6799b38 100644 --- a/test/bintest.asm +++ b/test/bintest.asm @@ -19,10 +19,10 @@ ; [10] Reference a data-section symbol in the data section ; [11] Reference a BSS-section symbol in the data section -[BITS 16] -[ORG 0x100] + BITS 16 + ORG 0x100 -[SECTION .text] + SECTION .text jmp start ; [6] @@ -44,13 +44,13 @@ start mov byte [bss_sym],',' ; [1] [8] mov bx,[textptr] ; [7] jmp bx -[SECTION .data] + SECTION .data datasym db 'hello world', 13, 10, '$' ; [2] bssptr dw bss_sym ; [2] [11] dataptr dw datasym+5 ; [2] [10] textptr dw end ; [2] [9] -[SECTION .bss] + SECTION .bss bss_sym resb 1 ; [3] diff --git a/test/cofftest.asm b/test/cofftest.asm index bb843a1..88044c0 100644 --- a/test/cofftest.asm +++ b/test/cofftest.asm @@ -22,17 +22,17 @@ ; [16] Reference a data-section symbol in the data section ; [17] Reference a BSS-section symbol in the data section -[BITS 32] -[GLOBAL _lrotate] ; [1] -[GLOBAL _greet] ; [1] -[GLOBAL _asmstr] ; [2] -[GLOBAL _textptr] ; [2] -[GLOBAL _selfptr] ; [2] -[GLOBAL _integer] ; [3] -[EXTERN _printf] ; [10] -[COMMON _commvar 4] ; [7] + BITS 32 + GLOBAL _lrotate ; [1] + GLOBAL _greet ; [1] + GLOBAL _asmstr ; [2] + GLOBAL _textptr ; [2] + GLOBAL _selfptr ; [2] + GLOBAL _integer ; [3] + EXTERN _printf ; [10] + COMMON _commvar 4 ; [7] -[SECTION .text] + SECTION .text ; prototype: long lrotate(long x, int num); _lrotate: ; [1] @@ -59,7 +59,7 @@ _greet mov eax,[_integer] ; [14] add esp,16 ret -[SECTION .data] + SECTION .data ; a string _asmstr db 'hello, world', 0 ; [2] @@ -73,7 +73,7 @@ localptr dd localint ; [5] [17] _textptr dd _greet ; [15] _selfptr dd _selfptr ; [16] -[SECTION .bss] + SECTION .bss ; an integer _integer resd 1 ; [3] diff --git a/test/elftest.asm b/test/elftest.asm index a6034a6..c5a729f 100644 --- a/test/elftest.asm +++ b/test/elftest.asm @@ -23,17 +23,17 @@ ; [16] Reference a data-section symbol in the data section ; [17] Reference a BSS-section symbol in the data section -[BITS 32] -[GLOBAL lrotate] ; [1] -[GLOBAL greet] ; [1] -[GLOBAL asmstr] ; [2] -[GLOBAL textptr] ; [2] -[GLOBAL selfptr] ; [2] -[GLOBAL integer] ; [3] -[EXTERN printf] ; [10] -[COMMON commvar 4] ; [7] + BITS 32 + GLOBAL lrotate ; [1] + GLOBAL greet ; [1] + GLOBAL asmstr ; [2] + GLOBAL textptr ; [2] + GLOBAL selfptr ; [2] + GLOBAL integer ; [3] + EXTERN printf ; [10] + COMMON commvar 4 ; [7] -[SECTION .text] + SECTION .text ; prototype: long lrotate(long x, int num); lrotate: ; [1] @@ -60,7 +60,7 @@ greet mov eax,[integer] ; [14] add esp,16 ret -[SECTION .data] + SECTION .data ; a string asmstr db 'hello, world', 0 ; [2] @@ -74,7 +74,7 @@ localptr dd localint ; [5] [17] textptr dd greet ; [15] selfptr dd selfptr ; [16] -[SECTION .bss] + SECTION .bss ; an integer integer resd 1 ; [3] diff --git a/test/inc1.asm b/test/inc1.asm index e9e5819..0e1058b 100644 --- a/test/inc1.asm +++ b/test/inc1.asm @@ -2,3 +2,5 @@ ; See inctest.asm for build instructions. message: db 'hello, world',13,10,'$' + +%include "inc2.asm" diff --git a/test/inctest.asm b/test/inctest.asm index 95ab40f..d6d35cf 100644 --- a/test/inctest.asm +++ b/test/inctest.asm @@ -5,11 +5,9 @@ ; nasm -f bin inctest.asm -o inctest.com ; and when run, it should print `hello, world'. -[BITS 16] -[ORG 0x100] + BITS 16 + ORG 0x100 jmp _main -[INC inc1.asm] - -[INCLUDE inc2.asm] +%include "inc1.asm" diff --git a/test/objtest.asm b/test/objtest.asm index 8530bae..24e9fbd 100644 --- a/test/objtest.asm +++ b/test/objtest.asm @@ -23,19 +23,19 @@ ; [15] Use SEG on a non-external ; [16] Use SEG on an external -[bits 16] + bits 16 -[global _bsssym] ; [1] -[global _function] ; [1] -[global _selfptr] ; [1] -[global _selfptr2] ; [1] -[common _commvar 2] ; [3] -[extern _printf] ; [6] + global _bsssym ; [1] + global _function ; [1] + global _selfptr ; [1] + global _selfptr2 ; [1] + common _commvar 2 ; [3] + extern _printf ; [6] -[group mygroup mybss mydata] ; [10] -[group mygroup2 mycode mycode2] ; [10] + group mygroup mybss mydata ; [10] + group mygroup2 mycode mycode2 ; [10] -[segment mycode private] + segment mycode private _function push bp mov bp,sp @@ -65,18 +65,18 @@ _function push bp .printf dw _printf, seg _printf ; [2] [4] [16] -[segment mycode2 private] + segment mycode2 private trampoline: pop ax push cs push ax jmp far _printf -[segment mybss private] + segment mybss private _bsssym resw 64 ; [12] -[segment mydata private] + segment mydata private _selfptr dw _selfptr, seg _selfptr ; [8] [15] _selfptr2 dw _selfptr2 wrt mydata, mydata ; [11] [13] |