;PROGRAM TO CONVERT 16-BIT BINARY NUMBER TO ITS EQUIVALENT BCD FORM
data segment
bin equ 1011b
result dw ?
data ends
code segment
assume cs:code, ds:data
start:
mov ax,data
mov ds,ax
mov bx,bin
mov ax,0h
mov cx,0h
again0:
cmp bx,0h
jz endprg
dec bx
mov al,cl
add al,01h
daa
mov cl,al
mov al,ch
adc al,00h
daa
mov ch,al
jmp again0
endprg:
mov result,cx
int 3
code ends
end start
Subscribe to:
Post Comments (Atom)
hi.please help
ReplyDeletehow to get binary string from user and convert to bcd