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

📄 67.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
        call dispstr
        mov dl,s6
        call dispscore
        call crlf

        lea dx,mess7
        call dispstr
        mov dl,s7
        call dispscore     
        call crlf
 
        lea dx,mess8
        call dispstr
        mov dl,s8
        call dispscore
        call crlf
 
        lea dx,mess9
        call dispstr
        mov dl,s9
        call dispscore  
        call crlf
 
        lea dx,mess10
        call dispstr
        mov dl,s10
        call dispscore     
        call crlf

        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

dispstr proc near
        mov ah,9
        int 21h
dispstr endp

dispscore proc near
       add dl,30h
       mov ah,2
       int 21h
dispscore 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 + -