结果错误
想把十进制数先转化为二进制再转换为十六进制,但结果显示错误,.,,找不出错在哪里..请帮忙..stack segment
dw 512 dup(?)
stack ends
data segment
a db 'welcome to this',0ah,0dh,'$'
b db 'the number is ','$'
data ends
code segment
assume cs:code,ds:data,ss:stack
start: mov ax,data
mov ds,ax
mov dx,offset a
mov ah,9
int 21h
xor bx,bx
putin: mov ah,1
int 21h
cmp al,'#'
jz endput
sub al,30h
shl bx,1
mov cx,bx
shl bx,1
shl bx,1
add bx,cx
add bx,ax
jmp putin
endput: mov dl,0ah
mov ah,2
int 21h
mov dl,0dh
mov ah,2
int 21h
mov dx,offset b
mov ah,9h
int 21h
mov dl,bl
mov ah,2
int 21h
mov ax,bx
mov bx,4
mov cl,4
_in:rol ax,cl
mov dl,al
and dl,0fh
add dl,30h
cmp dl,3ah
jb show
add dl,07h
show: mov ah,02h
int 21h
dec bx
jnz _in
_return:mov ax,4c00h
int 21h
code ends
end start