主题:如何计算非字符的个数
为什么这个程序并没有把大写变小写输出呢,还没计算非字符的个数也没有输出呢
data segment
inst db 90
db ?
db 90 dup(0)
count dw ?
input db 'please input string:',0ah,0dh,'$'
data ends
stack segment
dw 200 dup(0)
stack ends
code segment
assume cs:code,ds:data,ss:stack
start: mov ax,data
mov ds,ax
mov cx,count
next: mov dx,offset input
mov ah,9
int 21h
lea dx,inst
mov ah,10
int 21h
mov bl,inst+1
mov bh,0
mov byte ptr inst+[bx],'$'
lea bx,inst+2
loopgo:mov dl,[bx]
cmp dl,'$'
je exit
cmp dl,'A'
jb gos
add dl,20h
jmp disp2
gos: inc cx
jmp loopgo
disp1: mov dl,cx
mov ah,2
int 21h
disp2:
mov ah,2
int 21h
inc bx
jmp loopgo
exit: mov ax,4c00h
int 21h
code ends
end start
data segment
inst db 90
db ?
db 90 dup(0)
count dw ?
input db 'please input string:',0ah,0dh,'$'
data ends
stack segment
dw 200 dup(0)
stack ends
code segment
assume cs:code,ds:data,ss:stack
start: mov ax,data
mov ds,ax
mov cx,count
next: mov dx,offset input
mov ah,9
int 21h
lea dx,inst
mov ah,10
int 21h
mov bl,inst+1
mov bh,0
mov byte ptr inst+[bx],'$'
lea bx,inst+2
loopgo:mov dl,[bx]
cmp dl,'$'
je exit
cmp dl,'A'
jb gos
add dl,20h
jmp disp2
gos: inc cx
jmp loopgo
disp1: mov dl,cx
mov ah,2
int 21h
disp2:
mov ah,2
int 21h
inc bx
jmp loopgo
exit: mov ax,4c00h
int 21h
code ends
end start