说实话 偶不太懂你的意思
就按偶的理解写了个
.model small
.stack 200h
.data
arr db -1,1,0,' ','a',20h dup(2h)
buffer db 'zhengshu:
,fushu:
,ling:
,kongge:
,zimu:
',13,10,'$'
zhengshu db 0
fushu db 0
ling db 0
kongge db 0
zimu db 0
.CODE
_div proc
;被除数放在bl里
xor ax,ax
mov al,bl
mov cl,10d
@@:
div cl
add ah,30h
mov BYTE ptr [si],ah
dec si
or al,al
jz @return
xor ah,ah
jmp @B
@return:
ret
_div endp
START:
mov ax,@data
mov ds,ax
xor ax,ax
lea si,arr
mov cx,25h
@loop:
lodsb
or al,al
jz @zero
js @fushu
jg @zhengshu
@zero:
inc ling
jmp @F
@fushu:
inc fushu
jmp @F
@zhengshu:
inc zhengshu
cmp al,' ' ;是正数 再判断是不是字母 空格
jz @kongge
cmp al,'A'
jl @F
cmp al,'z'
jg @F
cmp al,'Z'
jle @zimu
cmp al,'a'
jge @zimu
jmp @F
@zimu:
inc zimu
jmp @F
@kongge:
inc kongge
jmp @F
@@:
loop @loop
int 3h
lea si,[buffer+12d]
mov bl,zhengshu
call _div
lea si,[buffer+23d]
mov bl,fushu
call _div
lea si,[buffer+33d]
mov bl,ling
call _div
lea si,[buffer+45d]
mov bl,kongge
call _div
lea si,[buffer+55d]
mov bl,zimu
call _div
lea dx,buffer
mov ah,9h
int 21h
;暂停,任意键关闭
mov ah,1
int 21h
mov ah,4ch
;结束,可以修改al设置返回码
int 21h
END START