assume cs:code
data segment
db 'abcde',0
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:mov dh,0
mov dl,0
mov cl,2
mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
mov di,0
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str:mov ch,0
push cx ;!!!
mov cl,ds:[di]
jcxz excout
mov al,0A0h
mul dh
mov bx,ax
mov al,2h
mul dl
add bx,ax
mov al,ds:[di]
mov es:[bx+si],al
pop cx ;!!!
mov es:[bx+si+1],cl ;把感歎號處去掉,此處cl換成2便可運行成功,但是cl是作為傳入參數
add di,1
add si,2
jmp short show_str
excout:ret
code ends
end start
好像是cx的問題
我自己解決了,是push cx後jcxz excout的pop ip取到了cx的值