Assembly language program for 2 digit bcd to binary conversion

; GIVEN BCD NUMBER SAY 24
; IT IS STORED AS IT IS IN MEMORY
; EVEN THOUGH IT IS STORED AS HEXADECIMAL 24
; IT IS NOT HEXADECIMAL 24 IT IS BCD 24
; NOW FOR BINARY CONVERSION
; SEPARATE 24 TO 02 AND 04
; MULTIPLY 04 BY 0A 04 TIMES THEN ADD 02 TO GET BINARY NUMBER
; THIS IS IN SHORT A DECIMAL TO HEXADECIMAL CONVERSION




; MVI B, 24H ;
; MOV A, B ;
; ANI 0FH ;
; MOV C, A ;
; MOV A, B ;
; ANI F0H ;
; RRC ;
; RRC ;
; RRC ;
; RRC ;
; MOV D, A ;
; XRA A ;
; MVI E, 0AH ;


LOOP:


; ADD E ;
; DCR D ; MULTIPLY WITH 0A REGISTER D TIMES
; JNZ LOOP ;
; ADD C ;
; STA XXXXH ;
; HLT ; END OF PROGRAM

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