这个是8086的写法
data segment ;这里定义一个数据段
tab db 'hello world$' ;这里用内存存放字节数据 'hellow world!',$用来判断字符串是否输出完毕
data ends ;数据段的结束标志
code segment ;这里定义了一个代码段
assume cs:code, ds:data ;这里把程序中定义的段与对应的段寄存器关联起来
start: ;这里是一个标号,根据end后面的标号判断这里是程序的开始位置
mov ax,data
mov ds,ax ;这里把数据段的地址放到数据段寄存器ds中
lea dx,tab ;dx中放将要显示数据的偏移地址
mov ah,9h
int 21h ;调用21号中断的9号功能来显示字符串
mov ah,4ch
int 21h ;程序返回
code ends ;代码段的结束语
end start ;定义程序从哪个标号处开始执行
汇编语言的"hello world"
最新推荐文章于 2024-04-08 22:29:35 发布