;
;2012-11-3 21:54:50
;屏幕输出10个'T'
crlf macro
push ax
push dx
mov ah,2;
mov dl,0ah;
int 21h
mov ah,2;
mov dl,0dh;
int 21h
pop dx
pop ax
ENDM
data segment
str dw 20h dup(0)
data ends
stack1 segment stack; 光定义堆栈段建立联系还是不够,需要利用segment的伪指令stack将stack1与堆栈区域组合
dw 20h dup(0)
stack1 ends
code segment
assume cs:code,ss:stack1,ds:data
start:
mov cx,10;loop前需要指定cx计数器的值,该值为循环次数
again:
mov ah,2
mov dl,'T'
int 21h
cmp cx,1
jz next
crlf
loop again;loop执行两个命令,一个跳转,一个cx-1 -> cx,直到cx=0结束
next:
mov ah,4ch
int 21h
code ends
end start
汇编link时提示no stack segment 解决
最新推荐文章于 2022-10-09 21:25:21 发布