Write Assembly language program for 2-Digit BCD to Binary conversion

; NEED TO USE CONCEPT OF POSITIONAL 
; WEIGHTING
; EXAMPLE: 34
; 34 = 3X0A + 4
; 34 = 1E + 4
; 34 = 22
; 2000H = 34H
;
;
LDA 2000H ;
ANI F0 ; A = 30
RRC ; MAKE MSB LSB
RRC
RRC
RRC
MVI B, 0AH ; B = 0A
CONTI ADD A ;
DCR B ;
JNZ CONTI ;
MOV B, A ; B = 1E = A
LDA 2000H ;
ANI 0F ; A = 4
ADD B ; A = 22
STA 2001H ; STORE 22
HLT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s