Paper-Ii Practical
Paper-Ii Practical
1 :
a) Program Name : Write a program that subtracts the number stored in 2021 from the number stored
in 2020. Store the absolute difference in memory location 2022 as result.
b) Enter the program on the microprocessor kit.
c) Execute the program for a positive as well as negative difference. Write the contents of data memory
loction before and after execution as well as the contents of the register used in the program afeter
execution and also the bit contents of all five flags individually. Verify the results.
Start
>
Load accumulator from memory
location 2000 H
>
Subtract 2021 H from
accumulator
>if N
A>0 > Store oH in A
Y
>
Stop
Program :
Memory Label Instruction Opcode Comments
Addess
2020 CD H
2021 AB H
Result : 2022 22 H
Program No 2 :
Program Name : A block of data is stored in memory location from 2020 H to 2023 H.Write a progarm to
find the greatest number from this block using Linear Search.Store the result immediately after the end
of the block.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locationsbefore and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Flowchart :
Start
>
Initialize H-l pair
>
Get count in C
>
Yes Is No. in
accumulator >
next No.
No
>
Decrement count
>
> No Is count = 0
Yes
>
Store Result
>
Stop
Program :
Addess
2020 03
2021 40
2022 65
2023 75
Result : 2120 75
Program No 3 :
Program Name : A block of data is stored in memory location from 2020 H to 2023 H.Write a progarm to
find the smallest number from this block using Linear Search.Store the result immediately after the end
of the block.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locationsbefore and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Start
>
Initialize H-l pair
>
Get count in C
>
Get first No. in accumulator
>
>
Yes Is No. in
accumulator <
next No.
No
>
Decrement count
>
> No Is count = 0
Yes
>
Store Result
>
Stop
Program :
Addess
2020 03
2021 15
2022 11
2023 12
Result : 2120 11
Program No 4 :
Program Name : A block of data is stored in memory location from 2021 H. The length of the block is
stored at 2020 H. Write a progarm that sorts the given data in ascending order.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locations before and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Program :
Addess
in accumulator
2020 05
2021 12 04
2022 54 12
2023 04 45
2024 A9 54
2025 45 A9
Program No 5 :
Program Name : A block of data is stored in memory location from 2021 H. The length of the block is
stored at 2020 H. Write a progarm that sorts the given data in descending order.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locations before and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Program :
Addess
in accumulator
2020 03
2021 11 14
2022 14 11
2023 01 01
Program No 6 :
Program Name : Write a progarm that multiplies two 1 byte hex nubers stored in consecutive memory
location starting from 2020 H. Store the 2 byte result in consecutive memory location starting from
2022 H begining with lower order byte.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locations before and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Start
>
Load B with value of location 2020 H
>
Initialize H-L pair by 2021 H & A, C with 00 H
>
>
>
Add contents of 2021 H in accumulator
>
N
if B >0 >
Y
>
Stop
Memory Label Instruction Opcode Comments
Addess
2020 02 H
2021 02 H
Result 2022 04 H
2023 00 H
Program No 7:
Program Name : Write a progarm that divides two 1 byte hex numbers where the dividend is stored in
2020 H and divisor is stored in 2021 H. Store the quotient and the reminder in th next memory location
respectively.
b) Execute the same on the microprocessor kit.
c) Execute the same. Write the contents of data memory locations before and after execution as well as
the contents of the registers used in the program after execution and also the bit contents of all five
flags individually. Verify the result.
Start
>
Load A with value of location 2020 H
>
Store 0H in B & 2021 H in H-L pair
>
>
>
Subtract value of memory from A
>
N
if A < 0 > Increment B
Y
>
Add M in A
>
Stop
Memory Label Instruction Opcode Comments
Addess
2020 05 H
2021 02 H
Result 2022 02 H
2023 01 H