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:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.