1st part ---> http://www.cramster.com/answers-mar-11/computer-science/700-points
ID: 3624543 • Letter: 1
Question
1st part ---> http://www.cramster.com/answers-mar-11/computer-science/700-points-intro-mips-file-required-2nd-part-questi_1214386.aspx****************************************************************************************************
Examine the code, load it into the spim simulator using the Open command in the File menu, then run
it on the simulator. (Click on Go in the Simulator menu, or click the third icon on the toolbar to run the
code.) After running the code on a few examples, use the single-step feature in the Simulator menu to
observe the contents of the $t0 and $t1 registers as the program executes one instruction at a time, then
muli-step using 2 or 3 instructions. Then, set a breakpoint to stop executing the code before the
“move $a0,$t0” instruction in the program using the Simulator menu and observe the results.
This program provides an example of how all of your programs should be documented in this course.
Note the information in the “Functional Description:”, “Pseudocode:” and “Register Usage:” header
sections. All your submitted codes this semester must have the same headings containing all relevant
and appropriate information under each heading.
Examine the loaded code and run the code as necessary to answer the below questions.
1. What is the hexadecimal memory address of the first instruction actually in add_integers.s, that
is, the first instruction after the initial set of instructions that appeared when you opened
PCspim or xspim?
2. What are the single hexadecimal memory addresses of the below constants declared in .data?
a. prompt
b. tmsg
c. nl
d. one
3. What is the hexadecimal memory address of the character u in the string array named tmsg?
4. Are the data stored as Big Endian or Little Endian? (Look at the storage of the 4-byte integer 1
declared in the .data section, which is not used by the code; other variables stored are strings
which show no difference between the two storage schemes.)
5. What is the hexadecimal memory address of the instruction associated with the label named
read?
6. What assembly language instruction is executed in place of the macro instruction
‘li $t0,0’?
7. Input the following 4 entries without the quotes: ‘4’, ‘10’, ‘-1’, ‘a’ and ‘0’. What was the
sum printed as output by the code and when did it print?
8. Describe what happened and explain why.
9. What is the hexadecimal representation of the 32-bit machine instruction generated by the
assembler for the assembly code instruction add $t0,$t0,$t1 ?
10. Described what you did to: (a) single step through the code and (b) set a breakpoint to get the
code to stop before executing instruction move $a0,$t0 .
Explanation / Answer
please rate - thanks
Examine the code, load it into the spim simulator using the Open command in the File menu, then run
it on the simulator. (Click on Go in the Simulator menu, or click the third icon on the toolbar to run the
code.) After running the code on a few examples, use the single-step feature in the Simulator menu to
observe the contents of the $t0 and $t1 registers as the program executes one instruction at a time, then
muli-step using 2 or 3 instructions. Then, set a breakpoint to stop executing the code before the
“move $a0,$t0” instruction in the program using the Simulator menu and observe the results.
This program provides an example of how all of your programs should be documented in this course.
Note the information in the “Functional Description:”, “Pseudocode:” and “Register Usage:” header
sections. All your submitted codes this semester must have the same headings containing all relevant
and appropriate information under each heading.
Examine the loaded code and run the code as necessary to answer the below questions.
1. What is the hexadecimal memory address of the first instruction actually in add_integers.s, that
is, the first instruction after the initial set of instructions that appeared when you opened
PCspim or xspim? the address of li $t0, 0 is 00400000
2. What are the single hexadecimal memory addresses of the below constants declared in .data?
a. prompt 10010003
b. tmsg 1001001F
c. nl 1001002C
d. one 10010030
3. What is the hexadecimal memory address of the character u in the string array named tmsg? 10010024
4. Are the data stored as Big Endian or Little Endian? (Look at the storage of the 4-byte integer 1 little endian
declared in the .data section, which is not used by the code; other variables stored are strings
which show no difference between the two storage schemes.)
5. What is the hexadecimal memory address of the instruction associated with the label named
read? 0x00400004
6. What assembly language instruction is executed in place of the macro instruction
‘li $t0,0’? ori $8, $0, 0
7. Input the following 4 entries without the quotes: ‘4’, ‘10’, ‘-1’, ‘a’ and ‘0’. What was the
sum printed as output by the code and when did it print? 13 after a was entered
8. Describe what happened and explain why. the instruction was to read an integer so, I believe, the character a that was in the input buffer was interpreted as the number 0
9. What is the hexadecimal representation of the 32-bit machine instruction generated by the
assembler for the assembly code instruction add $t0,$t0,$t1 ? 01094020
10. Described what you did to: (a) single step through the code press F10 to progress 1 instruction at a time and (b) set a breakpoint to get the
code to stop before executing instruction move $a0,$t0 . found the address this is instruction is at, it is 0x0040003c clicked on simulator breakpoints.
put this address in the address box of the breakpoint window, pressed add and the ran the simulation
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.