Open Watcom DOS 16bit EXE ASM Hello World


Build with Open Watcom Assember as a DOS 16Bit EXE
Run in Windows 98 or DOSBox

; hello.asm

.MODEL small
.STACK 100h
.286

.data
msg BYTE "Hello world",0dh,0ah
len  equ  $-msg

.code
main PROC
  mov ax,@data ; initialize DS
  mov ds,ax

  mov ah,40h   ; write to file
  mov bx,01h     ; output handle
  mov cx,len   ; number of bytes
  mov dx,OFFSET msg  ; address of buffer
  int 21h

  mov ah,4Ch   ; exit
mov al,00h   ; return code
  int 21h
main ENDP
END main
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s