Unpack the packed bcd numbers

; GIVEN
; 2000H = 42
; 2001H = 04
; 2002H = 02


LDA 2000H ; LOAD BCD NUMBER IN ACCUMULATOR
ANI F0H   ; MASK LOWER BYTE TO GET A = 40
RRC  ;
RRC  ;
RRC  ;
RRC  ; A = 04
STA 2001H ; STORE 04
LDA 2000H ; LOAD BCD NUMBER
ANI 0FH  ; MASK HIGHER BYTE TO GET A = 02
STA 2002H ; STORE 02
HLT  ;

One thought on “Unpack the packed bcd numbers

  1. Greetings! Quick question thatís completely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone. Iím trying to find a template or plugin that might be able to fix this problem. If you have any recommendations, please share. Appreciate it! 525988

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