实验11为啥debug老出错,程序错在哪?
assume cs:codesgdate segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
date ends
codesg segment
start: mov ax,date
mov ds,ax
mov si,0
call fuck
mov ax,4c00h
int 21h
fuck: cmp byte ptr ,0
je s2
cmp byte ptr ,'a'
jb s1
cmp byte ptr ,'z'
ja s1
mov al,
sub al,'A'-'a'
mov ,al
s1: inc si
jmp short fuck
s2: pop ax
ret
codesg ends
end start
是代码某些地方出错了么?我真没看出来啊。。。。。。。
assume cs:codesg
date segment
db "Beginner's All-purpose Symbolic Instruction Code.",0
date ends
codesg segment
start: mov ax,date
mov ds,ax
mov si,0
call fuck
mov ax,4c00h
int 21h
fuck: cmp byte ptr ,0
je s2
cmp byte ptr ,'a'
jb s1
cmp byte ptr ,'z'
ja s1
mov al,
;sub al,'A'-'a'
and al, 11011111
mov ,al
s1: inc si
jmp short fuck
s2: ;pop ax
ret
codesg ends
end start
堆栈不平衡, 在进入函数内部没有进行push ax操作, 却在函数返回时pop ax
要么在函数开投加入 push ax 要么 去掉popax
多次都没看出来错误后,愤怒的把标号改成了fuck! 额,我的错。。。 一直没看到最后就不看了
页:
[1]