⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yeathy3.asm

📁 汇编语言的实验报告
💻 ASM
字号:
datarea segment
                maxlen db 80
                actlen db ?
                string db 80 dup(?)
                mess db 'input:$'
                mess1 db 0ah,0dh,'letter:$'
                mess2 db 0ah,0dh,'digit:$'
                mess3 db 0ah,0dh,'other:$'
                letter dw ?
                digit dw ?
                other dw ?
           datarea ends
           prognam segment
           main proc far
                assume cs:prognam,ds:datarea
           start:
                push ds
                sub ax,ax
                push ax
                mov ax,datarea
                mov ds,ax
                mov dx,offset mess
                mov ah,09h
                int 21h
                mov dx,offset maxlen
                mov ah,0ah
                int 21h
                mov di,offset string
                mov letter,0
                mov digit,0
                mov other,0
           next:
                mov al,[di]
                cmp al,0dh
                jz exit
                cmp al,30h
                jc next3
                cmp al,3ah
                jc next2
                cmp al,41h
                jc next3
                cmp al,5bh
                jc next1
                cmp al,61h
                jc next3
                cmp al,7bh
                jc next1
                jmp next3
           next1:
                inc letter
                jmp next4
           next2:
                inc digit
                jmp next4
           next3:
                inc other
           next4:
                inc di
                jmp next
           exit:
                mov dx,offset mess1
                mov ah,09h
                int 21h
                mov bx,letter
                call show_msg
                mov dx,offset mess2
                mov ah,09h
                int 21h
                mov bx,digit
                call show_msg
                mov dx,offset mess3
                mov ah,09h
                int 21h
                mov bx,other
                call show_msg
                ret
            main endp
            show_msg proc near
                mov ch,4
            rotate:
                mov cl,4
                rol bx,cl
                mov al,bl
                and al,0fh
                add al,30h
                cmp al,3ah
                jl printit
                add al,7h
            printit:
                mov dl,al
                mov ah,2
                int 21h
                dec ch
                jnz rotate
                ret
            show_msg endp
            prognam ends
            end start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -