MESSAGE DB 'How do you do.',0DH,0AH,24H
0Dh,0Ah: 回车换行;
24h: $,DOS功能调用显示字符串用“$”作为结束符标志。
两个hello world
1
name "hello"
org 100h
jmp start
msg db ‘Hello, world!', 0
start: mov si,0
next_char:
mov al, msg[si]
cmp al, 0
je stop
mov ah, 0eh
mov 10h
inc si
jmp next_char
stop:
mov ah, 0
int 16h
ret
end
2(easiest)
name "hi"
org 100h
jmp start
msg: db "Hello, World!", 0Dh, 0Ah, 24h
start:
mov dx, msg ;load offset of msg into dx
mov ah, 09h
int 21h
mov ah, 0
int 16h
ret