编程查找字符串中某种字符的个数

来源:百度知道 编辑:UC知道 时间:2024/05/08 23:37:07
编程查找字符串中某种字符的个数

用汇编语言 编写这段程序的代码 谁可以帮忙写下

我们期末考试的题 谢谢了~~

data segment
count equ 10
string db 'kdjsal1323432xx,z.xm'
uchar db 0;大写字母个数
lchar db 0;小写字母个数
number db 0;数字个数
other db 0;其它字符个数
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov si,0
mov cx,count
next:
cmp number[si],30h
jb oth
cmp number[si],39h
ja cha
inc number
cha:
cmp number[si],41h
jb oth
cmp number[si],5ah
ja cha1
inc uchar
cha1:
cmp number[si],61h
jb oth
cmp number[si],7ah
ja oth
inc lchar
jmp next1
oth:
inc other
next1:
inc si
loop next
mov ah,4ch
int 21h
code ends
end start