2进制转换成10进制 怎么编程啊,谢谢
跪求,2进制转换成10进制 怎么编程啊,谢谢
假设要转换的二进制已经在bx中了
;*******************************************************
code segment
assume cs:code
start:
mov cx,10000
call decdiv
mov cx,1000
call decdiv
mov cx,100
call decdiv
mov cx,10
call decdiv
mov cx,1
call decdiv
mov ah,4ch
int 21h
decdiv proc near
mov ax,bx
mov dx,0
div cx
mov bx,dx
mov dl,al
add dl,30h;结果显示在屏幕上
mov ah,02h
int 21h
ret
decdiv endp
code ends
end start