view nasmbuild/nasm-2.13rc9/test/binexe.asm @ 10656:d14f0b444087

<oerjan> ` cd wisdom; mv {\xc3\x84,\xc3\xa4}; mv \'{\xc3\x85,\xc3\xa5}\'
author HackBot
date Thu, 13 Apr 2017 03:46:40 +0000
parents 587a0a262d22
children
line wrap: on
line source

;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