21,459
社区成员
发帖
与我相关
我的任务
分享
;masm 16位 宏汇编,完整段定义方式。
;数据段相当于c中的全局变量区
data segment
msg db "hello,world",0dh,0ah,"$"
data ends
;栈段 c中局部自动变量存储的地方
stack segment
db 256 dup (?)
stack ends
;代码段
code segment
assume cs:code,ds:data,ss:stack
start: ;代码开始执行处,名字任意。
mov ax,data
mov ds,ax
lea dx,msg
mov ah,09h
int 21h
mov ax,4c00h
int 21h
code ends
end start ;代码结束处,与开始一一对应。