新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 匯編:統(tǒng)計字符串內(nèi)各種字符的數(shù)目

匯編:統(tǒng)計字符串內(nèi)各種字符的數(shù)目

作者: 時間:2016-12-01 來源:網(wǎng)絡(luò) 收藏


;輸出num
mov ax,0
mov al,num
mov bl,10
div bl
mov dx,ax
add dx,3030h
cmp dl,30h
jne wuling3
mov dl,32
wuling3:
push dx
lea dx,result1
mov ah,09h
int 21h
pop dx
mov ah,02h
int 21h
mov dl,dh
mov ah,02h
int 21h
LEA DX,kongzi
MOV AH,09H
INT 21H
;輸出CAPITAL
MOV AX,0
MOV AL,CAPITAL
sub al,04h
MOV BL,10
DIV BL
MOV DX,AX
ADD DX,3030H
CMP Dl,30H
JNE WULING2
MOV Dl,32
WULING2:push dx
lea dx,result2
mov ah,09h
int 21h
pop dx
MOV AH,02h
INT 21H
MOV DL,DH
MOV AH,2
INT 21H

mov al,sum
sub al,capital
add al,04h
sub al,num
mov small,al

;輸出small capital
MOV AX,0
MOV AL,small
MOV BL,10
DIV BL
MOV DX,AX
ADD DX,3020H
CMP Dl,30H
JNE WULING4
MOV Dl,32 ;空格

WULING4: push dx
LEA DX,kongzi
MOV AH,09H
INT 21H
lea dx,result3
mov ah,09h
int 21h
pop dx


MOV AH,02h
INT 21H
MOV DL,DH
MOV AH,2
INT 21H

lea dx,kongzi
mov ah,09h
int 21h
lea dx,tip
mov ah,09h
int 21h
mov ah,01h
int 21h
cmp al,y
je lop

lea dx,kongzi
mov ah,09h
int 21h
lea dx,tip1
mov ah,09h
int 21h
over:
MOV AH,4CH
INT 21H
k2:inc capital
jmp main
k1: inc num
jmp main
lop:
lea dx,kongzi
mov ah,09h
int 21h
jmp start

CODE ENDS
END START

上一頁 1 2 下一頁

關(guān)鍵詞: 匯編字符

評論


技術(shù)專區(qū)

關(guān)閉