# NASM Hello world

C:\> type HelloDOS.asm
segment DATA
        Greeting db 'Hello DOS!$'

segment STACK stack
        resb 256
        StackPointer:

segment CODE
        ..start:

        mov ax, STACK
        mov ss, ax
        mov sp, StackPointer

        mov ax, DATA
        mov ds, ax
        mov dx, Greeting
        mov ah, 9
        int 21h

        mov ah, 4ch
        int 21h
C:\> nasm  HelloDOS.asm -f obj
C:\> alink HelloDOS.obj -o HelloDOS.exe
C:\> HelloDOS.exe

No comments: