Hello Gyes!

I have to convert a Hexa input to a Binary Output using emu8086.
1. Hexa number will be placed in AL
2.And output Binary will come in AX+ DX, Memory address will be 0507 to 0500

I tried to do but last of all i mixed up everything...

Plz Guys help me to do this problem. Thank you ..

1
Contributor
4
Replies
5
Views
9 Years
Discussion Span
Last Post by mahafuz_eee

Plz guys help me >>>>>>>

MOV AL, 0AH
MOV BX, 2H

MOV DX, 0000H
DIV BX

MOV [0500], DL
MOV DX,0000H
DIV BX

MOV [0501], DL
MOV DX, 0000H

DIV BX
MOV [0502], DL

MOV DX, 0000H
DIV BX

MOV DX, 0000H
MOV [0503], DL
DIV BX

MOV AX, [0500]
MOV BX, 1H
MUL BX

MOV AX, [0501]
MOV BX, 10H
MUL BX

MOV AX, [0502]
MOV BX, 100H
MUL BX

MOV AX, [0503]
MOV BX, 1000H
MUL BX

MOV AX, [0504]

RET

This is the Code. Buit in Th AX Register i Found 0110 But it Should be 1010.
PLEASE BROTHER ANY ONE HELP ME

; to convert a hexa number to a binary number

mov al,0ch
mov bl,2h

mov dx, 0000h
div bx
mov [0500],dl

mov dx, 0000h
div bx
mov [0501],dl

mov dx, 0000h
div bx
mov [0502],dl

mov dx, 0000h
div bx
mov [0503],dl

mov al, [0503]
mov bx, 1000h
mul bx

mov al, [0502]
mov bx, 100h
mul bx

mov al, [0501]
mov bl, 10h
mul bl

mov al, [0500]
mov bl, 1h
mul bl