datas segment info db 0dh, 0ah, 'Input ten scores:','$' ; 提示输入10个score o_ten db 0dh, 0ah, 'The number of 100 is :', '$' ; 输出提示 o_nine db 0dh, 0ah, 'The number of 90 to 99 is :', '$' o_eight db 0dh, 0ah, 'The number of 80 to 89 is :', '$' o_seven db 0dh, 0ah, 'The number of 70 to 79 is :', '$' o_six db 0dh, 0ah, 'The number of 60 to 69 is :', '$' s_ten db 30h ; 初始化 s_nine db 30h s_eight db 30h s_seven db 30h s_six db 30h datas ends stacks segment db 100 dup(?) ; 开辟100字节的栈空间 stacks ends codes segment assume cs:codes, ds:datas, ss:stacks start: mov ax, datas mov ds, ax lea dx, info mov ah, 9 int 21h mov cx, 10 input: mov ah, 1 ; 键盘录入并回显 int 21h mov dl, al ; al = 输入字符 int 21h call judge mov dl, 32 ; 输出空格,使输入更加清晰 mov ah, 2 ; 显示输出, dl = 输出字符 int 21h loop input call output mov ah, 4ch int 21h judge proc near cmp dl, 31h ; dl与1的ASCII码比较 jz ten cmp dl, 36h jz six cmp dl, 37h jz seven cmp dl, 38h jz eight cmp dl, 39h jz nine jmp fin ten: add [s_ten], 1 mov ah, 1 int 21h jmp fin six: add [s_six], 1 jmp fin seven: add [s_seven], 1 jmp fin eight: add [s_eight], 1 jmp fin nine: add [s_nine], 1 jmp fin fin: ret judge endp output proc near lea dx, o_ten mov ah, 9 int 21h mov dl, [s_ten] ; 输出100分的人数 mov ah, 2 int 21h mov dl, 10 ; 输出空格 int 21h lea dx, o_nine mov ah, 9 int 21h mov dl, [s_nine] ; 输出90-99的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_eight mov ah, 9 int 21h mov dl, [s_eight] ; 输出80-89的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_seven mov ah, 9 int 21h mov dl, [s_seven] ; 输出70-79的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_six mov ah, 9 int 21h mov dl, [s_six] ; 输出60-69的人数 mov ah, 2 int 21h ret output endp codes ends end start 解读代码
理解问题datas segment info db 0dh, 0ah, 'Input ten scores:','$' ; 提示输入10个score o_ten db 0dh, 0ah, 'The number of 100 is :', '$' ; 输出提示 o_nine db 0dh, 0ah, 'The number of 90 to 99 is :', '$' o_eight db 0dh, 0ah, 'The number of 80 to 89 is :', '$' o_seven db 0dh, 0ah, 'The number of 70 to 79 is :', '$' o_six db 0dh, 0ah, 'The number of 60 to 69 is :', '$' s_ten db 30h ; 初始化 s_nine db 30h s_eight db 30h s_seven db 30h s_six db 30h datas ends stacks segment db 100 dup(?) ; 开辟100字节的栈空间 stacks ends codes segment assume cs:codes, ds:datas, ss:stacks start: mov ax, datas mov ds, ax lea dx, info mov ah, 9 int 21h mov cx, 10 input: mov ah, 1 ; 键盘录入并回显 int 21h mov dl, al ; al = 输入字符 int 21h call judge mov dl, 32 ; 输出空格,使输入更加清晰 mov ah, 2 ; 显示输出, dl = 输出字符 int 21h loop input call output mov ah, 4ch int 21h judge proc near cmp dl, 31h ; dl与1的ASCII码比较 jz ten cmp dl, 36h jz six cmp dl, 37h jz seven cmp dl, 38h jz eight cmp dl, 39h jz nine jmp fin ten: add [s_ten], 1 mov ah, 1 int 21h jmp fin six: add [s_six], 1 jmp fin seven: add [s_seven], 1 jmp fin eight: add [s_eight], 1 jmp fin nine: add [s_nine], 1 jmp fin fin: ret judge endp output proc near lea dx, o_ten mov ah, 9 int 21h mov dl, [s_ten] ; 输出100分的人数 mov ah, 2 int 21h mov dl, 10 ; 输出空格 int 21h lea dx, o_nine mov ah, 9 int 21h mov dl, [s_nine] ; 输出90-99的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_eight mov ah, 9 int 21h mov dl, [s_eight] ; 输出80-89的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_seven mov ah, 9 int 21h mov dl, [s_seven] ; 输出70-79的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_six mov ah, 9 int 21h mov dl, [s_six] ; 输出60-69的人数 mov ah, 2 int 21h ret output endp codes ends end start 解读代码
已完成理解「datas segment info db 0dh, 0ah, 'Input ten scores:','$' ; 提示输入10个score o_ten db 0dh, 0ah, 'The number of 100 is :', '$' ; 输出提示 o_nine db 0dh, 0ah, 'The number of 90 to 99 is :', '$' o_eight db 0dh, 0ah, 'The number of 80 to 89 is :', '$' o_seven db 0dh, 0ah, 'The number of 70 to 79 is :', '$' o_six db 0dh, 0ah, 'The number of 60 to 69 is :', '$' s_ten db 30h ; 初始化 s_nine db 30h s_eight db 30h s_seven db 30h s_six db 30h datas ends stacks segment db 100 dup(?) ; 开辟100字节的栈空间 stacks ends codes segment assume cs:codes, ds:datas, ss:stacks start: mov ax, datas mov ds, ax lea dx, info mov ah, 9 int 21h mov cx, 10 input: mov ah, 1 ; 键盘录入并回显 int 21h mov dl, al ; al = 输入字符 int 21h call judge mov dl, 32 ; 输出空格,使输入更加清晰 mov ah, 2 ; 显示输出, dl = 输出字符 int 21h loop input call output mov ah, 4ch int 21h judge proc near cmp dl, 31h ; dl与1的ASCII码比较 jz ten cmp dl, 36h jz six cmp dl, 37h jz seven cmp dl, 38h jz eight cmp dl, 39h jz nine jmp fin ten: add [s_ten], 1 mov ah, 1 int 21h jmp fin six: add [s_six], 1 jmp fin seven: add [s_seven], 1 jmp fin eight: add [s_eight], 1 jmp fin nine: add [s_nine], 1 jmp fin fin: ret judge endp output proc near lea dx, o_ten mov ah, 9 int 21h mov dl, [s_ten] ; 输出100分的人数 mov ah, 2 int 21h mov dl, 10 ; 输出空格 int 21h lea dx, o_nine mov ah, 9 int 21h mov dl, [s_nine] ; 输出90-99的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_eight mov ah, 9 int 21h mov dl, [s_eight] ; 输出80-89的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_seven mov ah, 9 int 21h mov dl, [s_seven] ; 输出70-79的人数 mov ah, 2 int 21h mov dl, 10 int 21h lea dx, o_six mov ah, 9 int 21h mov dl, [s_six] ; 输出60-69的人数 mov ah, 2 int 21h ret output endp codes ends end start 解读代码」
展开阅读网页