BCD to Binary conversion

;PROGRAM TO CONVERT BCD NUMBER TO BINARY NUMBER

data segment

bcd equ 4567h

result dw ?

data ends

code segment

assume cs:code, ds:data

start:

mov ax,data

mov ds,ax

mov bx,bcd

mov ax,0h

mov cx,0h

again0:

cmp bx,0h

jz endprg

mov al,bl

sub al,01h

das

mov bl,al

mov al,bh

sbb al,00h

das

mov bh,al

inc cx

jmp again0

endprg:

mov result,cx

int 3

code ends

end start

2 comments:

  1. Intolerance is the most socially acceptable form of egotism, for it permits us to assume superiority without personal boasting. See the link below for more info.


    #assume
    www.ufgop.org


    ReplyDelete
  2. This is really interesting and knowledgeable. Thanks for sharing. I really appreciate it a lot. Please do more blogs in the future. Thank you and God bless to the blogger!

    Rica
    www.imarksweb.org

    ReplyDelete