February 04, 2012
Write a program to store the data 60 H into memory location 2050 H.
Apparatus Used: Microprocessor kit, Keyboards
Assumption: We have to store given data at memory location 2050 H.
Algorithm:
- Store the number in the accumulator.
- Store the content of accumulator at given address.
Program:
Memory Add
|
Mnemonics
|
Op-code
|
Comments
|
2000
|
MVI
|
A,60 H
|
Store the data in accumulator
|
2002
|
STA
|
2050
|
Store the data at 2050 H
|
2005
|
RST
|
5
|
Set Break-point
|
2006
|
END
|
End the program
|
Second Method
Memory Add
|
Mnemonics
|
Op-code
|
Comments
|
2000
|
LXI
|
H,2050 H
|
Store the location in H-L Pair
|
2002
|
MVI
|
M,60
|
Store the data at 2050 H
|
2005
|
RST
|
5
|
Set Break-point
|
2006
|
END
|
End the program
|
Description of used instruction:
LXI: This instruction is used to store the 16-bit data in the register pair designated in the operand.
MVI: This instruction is used to store 8 bit data in specified register.
STA: This instruction is used to store the content of accumulator at specified memory address.
RST 5: This instruction is used to set break-point for the execution.
END: This instruction is used to execute the program.
Result:
Input:
A-60 H
Output:
2050-60 H
Procedure to look output
- After press ENTER, You will get first screen
- Press G and Provide Initial address (as 2000)
- Press SHIFT+4,You will get first screen again
- Press M and Provide address for output (M 2050) and press ENTER
- You will get your desired output.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment