summaryrefslogtreecommitdiff
path: root/test/binexe.asm
diff options
context:
space:
mode:
authorHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:52:20 +0900
committerHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:52:20 +0900
commite6c15f0e49b4ea41b5c5eb36457db0127ec901fc (patch)
tree996be9095a97ff2aac0d98963b6044d47a0ec60c /test/binexe.asm
parent65c26d26fb72cec0d43d199c72ed27513d17f4c9 (diff)
downloadnasm-tizen_2.0.tar.gz
nasm-tizen_2.0.tar.bz2
nasm-tizen_2.0.zip
Diffstat (limited to 'test/binexe.asm')
-rw-r--r--test/binexe.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/binexe.asm b/test/binexe.asm
new file mode 100644
index 0000000..2a9eb6e
--- /dev/null
+++ b/test/binexe.asm
@@ -0,0 +1,35 @@
+;Testname=unoptimized; Arguments=-O0 -fbin -obinexe.exe -i../misc/; Files=stdout stderr binexe.exe
+;Testname=optimized; Arguments=-Ox -fbin -obinexe.exe -i../misc/; Files=stdout stderr binexe.exe
+
+; Demonstration of how to write an entire .EXE format program by using
+; the `exebin.mac' macro package.
+; To build:
+; nasm -fbin binexe.asm -o binexe.exe -ipath
+; (where `path' is such as to allow the %include directive to find
+; exebin.mac)
+; To test:
+; binexe
+; (should print `hello, world')
+
+%include "exebin.mac"
+
+ EXE_begin
+ EXE_stack 64 ; demonstrates overriding the 0x800 default
+
+ section .text
+
+ mov ax,cs
+ mov ds,ax
+
+ mov dx,hello
+ mov ah,9
+ int 0x21
+
+ mov ax,0x4c00
+ int 0x21
+
+ section .data
+
+hello: db 'hello, world', 13, 10, '$'
+
+ EXE_end