用用堆栈传递参数的问题
编写一个主程序,从键盘接受几个字符,然后用远调用的方法,调用的方法,调用子程序统计字符‘X’的个数。子程序的参数是字符串的首地址TABLE,字符串长度N及字符‘X’的个数。子程序将返回字符‘X’的个数。参数传送采用堆栈实现 。主程序在子程序返回 后,显示字符 ‘X’的个数 (设为1位16进制)。帮我 程序 写一下,再写下每布的 注释,谢谢 了 。再看看我程序
data segment
table db 11
db ?
db 11 dup(?)
n db ?
data ends
stacka segment stack
db 100 dup(?)
stacka ends
code segment
assume cs:code,ds:data,ss:stacka
start: mov ax,data
mov ds,ax
mov ax,stacka
mov ss,ax
lea si,table
mov ah,0ah
int 21h
kk: mov ax,word ptr table[si+2]
push ax
add si,2
cmp si,9
jbe kk
push ax
mov ax,3342h
push ax
mov ax,7474h
call far ptr vitas
mov dl,n
mov ah,2
int 21h
vitas proc far
pop ax
mov ax,4322h
pop ax
mov ax,4335h
pop ax
mov cl,table[si+1]
gg: cmp [si],78h
jne next
inc n
next: inc si
loop gg
ret
vitas endp
code ends
end start