5. (20 points) write the assembly language instructions to store 10 numbers in R
ID: 2080599 • Letter: 5
Question
5. (20 points) write the assembly language instructions to store 10 numbers in RAM starting at address 20BOH. Use the ADI instruction to make each number stored 5 larger than the previous one. The first location should contain the data byte 00H. Note: The comments in the table are made just to help you write the assembly language instructions as indicated by the question marks. Simply follow the steps in the comments, you will get the job done easily. Label Assembly Language Comments Starting location of RAM 7 B Counter for 10 numbers 7 A holds numbers to be stored Move number to memory Add 6 to A Next memory location Decrement counter JNZ LOOP Loop back to store next number HLT EndExplanation / Answer
ORG 2000H ; starting memory location
MVI B, 09 ; counter for 10 numbers
LXI H, 20B0H ;set pointer for dara
MOV A, 00H ; A will containt 0
LOOP MOV M, A ; move content of accumulator to memory
ADI 06H ; add 6 to accumulator
INX H ; increment pointer to go to next memory location
DCR B ; decrement pointer
JNZ LOOP ; Jump if not equal to zero to LOOP
HLT ; End
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.