毋容置疑。所有的编程大部分都是打印hello world 开始的
上代码
data segment #定义一个data段
db 20 dup(1) //写入ds寄存器20的1
db 'hello world$' //写入hello world到寄存器
data ends
stack segment
db 20 dup(2) //定栈寄存器
stack ends
code segment
start:
mov ax, data //取出data地址
mov ds, ax //给ds寄存器地址方便调用
mov ax, stack //原理同上
mov ss, ax
mov dx, 20 //打印默认会到ds取值,dx取偏移量
mov ah, 9h //dos打印字符
int 21h
mov ah, 4cH //中断程序
int 21H
code ends
end start
网友评论