汇编第一个程序 Hello World (初学者与入门)

1、下载个masm5.0 编译器 http://xiazai.zol.com.cn/detail/14/132320.shtml 

2、data segment
string db'Hello World!The first program ',0AH,0DH,'$'
data ends

code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov dx,offset string
mov ah,09h int 21h
mov ah,07h ;7号功能调用从键盘接收一个字符
int 21h
mov ah,4ch
int
21h
code ends
end start

把这段代码用记事本保存为xx.asm 格式的文件 保存在masm5.0文件下
3、cmd (大家都懂不解释) --> 进去masm5.0 文件夹下 4、开始编译 masm xx.asm 单击回车三次 可以得到 后缀为xx.obj的文件 5、link xx.obj 单击回车三次 可以得到xx.exe的可执行文件

6、运行xx.exe 就可以得到hello world !The first program

 

  • 以前是本人的总结 可能有些专业术语不太对 希望大家理解
posted @ 2012-06-11 17:00  Elite_Y  阅读(381)  评论(0编辑  收藏  举报