标题:汇编代码求详细注释
取消只看楼主
q309533398
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-6-9
结帖率:0
已结贴  问题点数:0 回复次数:0 
汇编代码求详细注释
; multi-segment executable file template.

data segment
    ; add your data here!
    pkey db "press any key...",13,'$'
    wa1 db "0--59",13,'$'
    wa2 db "60--74",13,'$'
    wa3 db "75--89",13,'$'
    wa4 db "90--100",13,'$'
    aa:db 50,52,53,54,55,60,62,63,64,65,70,72,73,74,75,80,85,90,95,99
ends

stack segment
    dw   128  dup(0)
ends

code segment
start:
; set segment registers:
    mov ax, data
    mov ds, ax
    mov es, ax

    ; add your code here
lea si,aa   
mov cx,20
 mov al,0  
 mov dh,0
 mov bl,0
 mov bh,0
next:
cmp [si],60
jnb  a1
add al,1   

jmp  wahaha

a1:cmp [si],75   
jnb  a2
add dh,1
jmp  wahaha

a2:cmp [si],90  
jnb  a3
add bl,1
jmp  wahaha

a3:add bh,1
 
wahaha:
inc si

loop next
lea dx, pkey
    mov ah, 9
    int 21h
ADD AL,48
MOV DL,AL
MOV AH,2
INT 21H  
lea dx, pkey
    mov ah, 9
    int 21h
ADD dh,48
MOV DL,dh
MOV AH,2
INT 21H  
lea dx, pkey
    mov ah, 9
    int 21h
ADD bl,48
MOV DL,bl
MOV AH,2
INT 21H  
lea dx, pkey
    mov ah, 9
    int 21h
ADD bh,48
MOV DL,bh
MOV AH,2
INT 21H

ret

            
    lea dx, pkey·
    mov ah, 9
    int 21h        ; output string at ds:dx
   
    ; wait for any key....   
    mov ah, 1
    int 21h
   
    mov ax, 4c00h ; exit to operating system.
    int 21h   
ends

end start ; set entry point and stop the assembler.
求每一句代码的详细注释,很重要,我是新手,谢谢了!
搜索更多相关主题的帖子: 128 registers file 
2011-06-09 18:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-342328-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.189413 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved