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

📄 67f2.asm

📁 本书为清华大学第二版汇编语言的课后题详解
💻 ASM
字号:
;6_7.asm

;*************************************************************************
datasg  segment
grade   db 76,69,84,90,73,88,99,63,100,80
s6      db 0
s7      db 0
s8      db 0
s9      db 0
s10     db 0
mess6  db '60~69:$'
mess7  db '70~79:$'
mess8  db '80~89:$'
mess9  db '90~99:$'
mess10  db '100:$'
datasg  ends
;*************************************************************************
codesg  segment
;-----------------------------------------------------------------------
main    proc  far
        assume cs:codesg,ds:datasg
start:
        push ds
        sub  ax,ax
        push ax

        mov  ax,datasg
        mov  ds,ax
        call sub1
        
        lea dx,mess6
        lea di,s6
        mov cx,5
disp:   mov si,dx
        mov ah,9
        int 21h
        
        mov dl,[di]
        add dl,30h
        mov ah,2
        int 21h
        call crlf
 
        add di,1
        add si,7
        mov dx,si
        
        loop disp
                

        ret
main    endp
;-------------------------------------------------------------------------
sub1    proc near
        mov  cx,10
        mov  si,0
loop1:  mov  al,grade[si]
        cmp  al,60
        jl   next5
        cmp  al,70
        jge  next1
        inc  s6
        jmp  short next5
next1:  cmp  al,80
        jge  next2
        inc  s7
        jmp  short  next5
next2:  cmp  al,90
        jge  next3
        inc  s8
        jmp  short  next5
next3:  cmp  al,100
        jg  next5
        je  next4
        inc  s9
        jmp  short next5
next4:  inc  s10
next5:  inc  si
        loop loop1
        ret
sub1    endp


crlf proc near
    mov dl,0dh
    mov ah,2
    int 21h
    mov dl,0ah
    mov ah,2
    int 21h
    
    ret
crlf endp

;-------------------------------------------------------------------------
codesg  ends
;*************************************************************************
        end  start

⌨️ 快捷键说明

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