summaryrefslogtreecommitdiff
path: root/test/binexe.asm
diff options
context:
space:
mode:
Diffstat (limited to 'test/binexe.asm')
-rw-r--r--test/binexe.asm32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/binexe.asm b/test/binexe.asm
new file mode 100644
index 00000000..ab852fb9
--- /dev/null
+++ b/test/binexe.asm
@@ -0,0 +1,32 @@
+; 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