匯編:輸入一位十六進(jìn)制數(shù)將其轉(zhuǎn)化為2進(jìn)制數(shù)
mov ax,0
mov al,bl
mov dx,0;初始化
mov di,0;指針為0
mov bl,02h
quyu:
div bl ;默認(rèn) ax
mov yushu[di],ah
inc di
mov ah,0
cmp al,02h
jae quyu
mov yushu[di],al
inc di
mov cx,di
dec di
shuchu:
mov dl,yushu[di]
dec di
add dl,30h
mov ah,02h
int 21h
jmp jiedian
jiedian:
loop shuchu
jmp over
tishi:
lea dx,kongzi;控制換行回車
mov ah,09h
int 21h
lea dx,tital3;輸出抬頭3
mov ah,09h
int 21h
jmp retry
over:
lea dx,kongzi
mov ah,09h
int 21h
lea dx,tital4
mov ah,09h
int 21h
mov ah,01h
int 21h
cmp al,y
jz retry
lea dx,kongzi
mov ah,09h
int 21h
lea dx,tital5
mov ah,09h
int 21h
;結(jié)束
mov ah,4ch
int 21h
code ends
end start
評(píng)論