主题:在线等高手指教!一个汇编程序,不知道错在那里??
data segment
kb_buffer db 100 dup(?)
nsum db ?
data ends
code segment
assume cs:code,ds:data
start:mov ax,code
mov cs,ax
mov ax,data
mov ds,ax
mov cl,0
mov dx,offset kb_buffer
mov ah,10
int 21h
lp: mov si,dx
mov al,[si]
cmp al,23h
je exit
cmp al,'0'
jb other
cmp al,'9'
ja other
inc cl
other:inc,dx
jmp lp
exit: mov nsum,cl
mov ah,4ch
int 21h
code ends
end start
kb_buffer db 100 dup(?)
nsum db ?
data ends
code segment
assume cs:code,ds:data
start:mov ax,code
mov cs,ax
mov ax,data
mov ds,ax
mov cl,0
mov dx,offset kb_buffer
mov ah,10
int 21h
lp: mov si,dx
mov al,[si]
cmp al,23h
je exit
cmp al,'0'
jb other
cmp al,'9'
ja other
inc cl
other:inc,dx
jmp lp
exit: mov nsum,cl
mov ah,4ch
int 21h
code ends
end start