Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that prints the content of the instruction memory, in effect, di

ID: 642776 • Letter: W

Question

Write a program that prints the content of the instruction memory, in effect, disassembling the program. Start with the default program memory address of 0x00400000; read words from the memory sequentially and output the first N instructions on the console. N will be an integer read from the keyboard.

As an example, if you have:

Address Content
------------------------------------
[0x00400000] 0x3408010a
[0x00400004] 0x3409000c
[0x00400008] 0x01195120

in the memory, the result of running your program with N = 3, would print the following to the console window:

0x3408010a
0x3409000c
0x01195120

Explanation / Answer

la $a0, hello_again //here input word
  

li $t0, 10 # countdown //here giving loop counter to print required address
for10:
li $a0, 4 #print string call
endfor10:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote