data segment
string db "hello,bad boy",0ah,0dh,'$'
data ends
code segment
mainbegin macro
mov ax,data
mov ds,ax
endm
mainend macro
mov ah,4ch
int 21h
endm
dispmsg macro message
mov dx,offset message
mov ah,09h
int 21h
endm
start:
assume cs:code,ds:data
mainbegin
dispmsg string
mainend
code ends
end start

此博客展示了一段汇编语言代码,定义了数据段和代码段。在数据段中定义了字符串,代码段里使用宏定义实现初始化、结束程序和显示消息等功能,最终实现字符串“hello,bad boy”的输出。
433

被折叠的 条评论
为什么被折叠?



