Hello Gyes!
I am very new in Using emu8086 and i need a code about this Program Problem:

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 ..

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

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

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

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

ADD [0504], AX
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
add [0508],ax


mov al, [0502]
mov bx, 100h
mul bx
add [0508],ax


mov al, [0501]
mov bl, 10h
mul bl
add [0508],ax


mov al, [0500]
mov bl, 1h
mul bl
add [0508],ax


mov ax,[0508]

ret

this is the solution. u all are chitter and dont even try to help in this simple program.

This question has already been answered. Start a new discussion instead.