新手 求帮助 把下面程序注解一下 谢谢啦
;----------------------------------------;程序功能:代码转换,共实现五个功能
;1.小写转大写
;2.大写转小写
;3.二进制转十六进制
;4.十六进制转二进制
;5.十六进制转十进制
;-----------------------------------------
;*************************数据段开始
data segment
screen0 db 'please input the function you want to achieve',0ah,0dh
screen1 db '1. xiao xie to da xie',0ah,0dh
screen2 db '2. da xie to xiao xie',0ah,0dh
screen3 db '3. B(2) to H(16)',0ah,0dh
screen4 db '4. H(16) to B(2)',0ah,0dh
screen5 db '5. H(16) to D(10)','$'
xtod db 'input a low letter:$'
dtox db 'input a capital letter:$'
BtoHh db 'input a number of binary(0000--1111):$'
HtoBh db 'input a number of hex(0-F):$'
HtoDh db 'input a number of hex(0--F):$'
buf0 db 17
buf1 db 0
buf db 17 dup('$')
num db 0
data ends
;************************数据段结束
STAK SEGMENT STACK
DW 100 DUP (?)
STAK ENDS
cr macro
push ax
push dx
mov dl,0ah
mov ah,2
int 21h
mov dl,0dh
mov ah,2
int 21h
pop dx
pop ax
endm
writes macro a
lea dx,a
mov ah,9
int 21h
endm
write macro c
mov dl,c
mov ah,2
int 21h
endm
;*******************代码段开始
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
go: writes screen0
;*******************处理用户选择功能模块
cr
mov ah,1
int 21h
cmp al,'q'
jz done
cmp al,31H
jz R1
cmp al,32H
jz R2
cmp al,33H
jz R3
cmp al,34H
jz R4
cmp al,35H
jz R5
jmp done
;******************跳转到小写转大写子程序
R1: call smalltobig
jmp go
;******************跳转到大写转小写子程序
R2: call bigtosmall
jmp go
;******************跳转到二进制转十六进制子程序
R3: call BtoH
jmp go
;******************跳转到十六进制转二进制子程序
R4: call HtoB
cr
jmp go
;*****************跳转到十六进制转十进制子程序
R5: call HtoD
jmp go
;****************结束程序并返回
done: mov ah,4ch
int 21h
;小写转大写子程序
smalltobig proc
writes xtod
cr
call input
cr
sub al,20h
write al
cr
ret
smalltobig endp
;大写转小写子程序
bigtosmall proc
writes dtox
cr
call input
cr
add al,20h
write al
cr
ret
bigtosmall endp
;二进制转十六进制子程序
BtoH proc
writes BtoHh
cr
mov bl,0
loopa: mov ah,1
int 21h
cmp al,13
jz n
cmp al,30h
jb loopa
cmp al,31h
ja loopa
and al,0fh
add bl,al
shl bl,1
jmp loopa
n: cr
shr bl,1
cmp bl,9
jb nn
add bl,7
nn: add bl,30h
write bl
cr
ret
BtoH endp
;十六进制转二进制子程序
HtoB proc
writes HtoBh
cr
call input
cr
sub al,30h
cmp al,9
jna loop1
sub al,7
loop1: mov cl,4
shl al,cl
mov cl,4
mov bl,al
gg: shl bl,1
jc lop
mov dl,'0'
jmp lop1
lop: mov dl,'1'
lop1: mov ah,2
int 21h
loop gg
ret
HtoB endp
;十六进制转十进制子程序
HtoD proc
writes HtoDh
cr
mov bx,0
tt: call input
cmp al,13
jz y1
cmp al,'9'
jna y2
sub al,7
y2: sub al,30h
mov cl,4
mov ah,0
add bx,ax
shl bx,cl
jmp tt
y1: cr
shr bx,cl
mov ax,bx
aaa
add ax ,3030h
mov bx,ax
write bh
write bl
cr
ret
HtoD endp
;输入子程序
INPUT PROC
mov ah,1
int 21h
RET
INPUT ENDP
code ends
end start