Thursday 1 May 2008

Assembler: Hello, World! [2]

NASM version 0.98.39 compiled on Feb 25 2005
DOS, 16bit, x86

;syntax expected by NASM
;DOS, x86, 16bit
org 100h        ;start at address 100
mov ax,0200h    ;AH=2
mov dx,0048h    ;'H'
int 21h         ;int 21,2 (print char)
mov dx,0065h    ;'e'
int 21h
mov dx,006Ch    ;'l'
int 21h
mov dx,006Ch    ;'l'
int 21h
mov dx,006Fh    ;'o'
int 21h
mov dx,002Ch    ;','
int 21h
mov dx,0020h    ;' '
int 21h
mov dx,0057h    ;'W'
int 21h
mov dx,006Fh    ;'o'
int 21h
mov dx,0072h    ;'r'
int 21h
mov dx,006Ch    ;'l'
int 21h
mov dx,0064h    ;'d'
int 21h
mov dx,0021h    ;'!'
int 21h
int 20h         ;int 20 (terminate)



Compare and contrast with the debug.exe version.

No comments:

Post a Comment

All comments are moderated