CS II-Program 10
CS II-Program 10
CS II-Program 10
Aim: Write a program that seperates the two nibbles of a number stored in 2060 and stores the
same in memory location 2061 and 2062. The program must also multiply the nibbles and store
the result in 2063.
Algorithm:
1. Initialize product with zero and accumulator with memory location 2060.
2. Separate the two nibbles of a number and store it in Nib1 and Nib2.
3. Assign Nib1 and Nib2 to memory location 2061 and 2062.
4. Repeat the step till Nib 2 =0
5. a) Add Nib 1 value with product.
b) Decrement Nib2 by one.
6. Store the product of 2 Nib’s in memory location 2063.
7. Stop program execution.
Flowchart:
PROGRAM 12
Mnemonics
Address Label Opcode Operand Hexacode Comment
2000 START LXI H, 2060 21 Initialize HL with 2060
2001 60 Lower address byte
2002 20 Upper address byte
Move memory data to
2003 MOV A, M 7E Accumulator