151
Solution
e method to be adopted is just opposite of the method adopted in the previous example.
Algorithm
Step 1: Load pointer by address of MS BCD digit.
Step 2: Load MS BCD digit in the accumulator.
Step 3: Increment pointer by 1 to target LS BCD digit.
Step 4: Rotate the accumulator left four times to shift MS BCD digit to upper nibble.
Step 5: OR accumulator with LS BCD digit as pointed by the pointer.
Step 6: Store the accumulator in R7 and return.
; Subroutine to pack two BCD digits.
PACKIT: MOV R0, #30H ; load pointer by fi rst address
MOV A, @R0 ; get MS digit in the accumulator
INC R0 ; point to next location
RL A ; shift digit to upper nibble
RL A
RL A
RL A
ORL A, @R0 ; merge with lower ...