How to convert BCD into binary in 8086 Microprocessor?
(Edited)
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:
Posted with STEMGeeks
stemgeeks
stem
engineering
technology
microprocessor
processor
software
programming
coding
computers
0
0
0.000
0 comments