binexe.asm
Upload User: yuppie_zhu
Upload Date: 2007-01-08
Package Size: 535k
Code Size: 1k
Development Platform:

C/C++

  1. ; Demonstration of how to write an entire .EXE format program by using
  2. ; the `exebin.mac' macro package.
  3. ; To build:
  4. ;    nasm -fbin binexe.asm -o binexe.exe -ipath
  5. ; (where `path' is such as to allow the %include directive to find
  6. ; exebin.mac)
  7. ; To test:
  8. ;    binexe
  9. ; (should print `hello, world')
  10. %include "exebin.mac"
  11.   EXE_begin
  12.   EXE_stack 64 ; demonstrates overriding the 0x800 default
  13.   section .text
  14.   mov ax,cs
  15.   mov ds,ax
  16.   mov dx,hello
  17.   mov ah,9
  18.   int 0x21
  19.   mov ax,0x4c00
  20.   int 0x21
  21.   section .data
  22. hello:   db 'hello, world', 13, 10, '$'
  23.   EXE_end