一个简单的masm汇编hello world

初学汇编,找个几个helloworld都不是很的要领,于是只好自己写了一个……

用的是masm5.0编译……

 

datarea segment
  string   db      'Hello world!' , 13 , 10 , '$'   ;'$' is important!
datarea ends

 

prognam segment
main proc far
assume cs:prognam,ds:datarea
start:
        push ds
        sub ax,ax  ;清空ax
        push ax  

        mov ax,datarea
        mov ds,ax  

        lea dx,string
        mov ah,09  ;调用09中断输出
        int 21h
        ret  ;退出
main endp
prognam ends
end start

posted @ 2010-11-07 15:02  Jesse_Luo  阅读(1757)  评论(0)    收藏  举报