jazzbel avatar

How to convert BCD into binary in 8086 Microprocessor?

jazzbel1

Published: 19 Oct 2021 › Updated: 19 Oct 2021How to  convert BCD into binary in 8086 Microprocessor?

How to convert BCD into binary in 8086 Microprocessor?

360_F_236084095_fcsVPPzPEa1n0a6CeAhpX1s8zjVshP5C.jpg

To convert BCD into binary.

Code:
DATA_SEG SEGMENT
BCD DB 20H ; STORAGE FOR A BCD VALUE
BIN DB ? ; STORAGE FOR BINARY VALUE
DATA_SEG ENDS

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:DATA_SEG
START:
MOV AX,DATA_SEG
MOV DS,AX

MOV AH,BCD      
MOV BH,AH 
AND BH,0FH 
AND AH,0F0H 
ROR AH,04  
MOV CL,10  
MOV AL,AH 
AND AX,00FFH 
MUL CL 
ADD AL,BH 
MOV BIN,AL   
MOV AH,04CH 
INT 21H 
CODE_SEG ENDS 

END START

Output:

image.png

Leave How to convert BCD into binary in 8086 Microprocessor? to:

Written by

Read more #stemgeeks posts


Best Posts From jazzbel

We have not curated any of jazzbel1's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From jazzbel