Question: [5 parts) Given: Consider the following MIPS program and the memory addresses and contents for the code. Instruction Address(decimal) Assembled Instruction No. 1 label: add





[5 parts) Given: Consider the following MIPS program and the memory addresses and contents for the code. Instruction Address(decimal) Assembled Instruction No. 1 label: add $to, $zero, Sto 40000 2 addi $sp,$sp, -8 3 sw $ra, 4($sp) 5w $ao, D($sp) 5 slti Sto, $a0,1 6 beq $ao, Szero, EXIT 7 addi Svo, Szero, 1 8 0 2 1 addi $sp,$sp, 8 jr Sra EXIT: addi$a0, $a0, -1 11 jal label 8 9 10 Part 1: If the code starts at address 40000 as shown above: The address of instruction no. 7 is: a) 40006 Part 1: If the code starts at address 40000 as shown above: The address of instruction no. 7 is: a) 40006 b) 40012 C) 40024 d) 40048 e) 40096 f) 40192 8) 40384 h) 40768 Answer 1: (Note: Indicate ONLY the LETTER corresponding to your choice) Part 2: Name the addressing modes used in the following instructions: No. 5 (slti): No. 6 (beq): No. 9(jr) : a) siti: PC-relative, beq: immediate, jr: Pseudo-Direct b) slti: immediate, beq: Pseudo-Direct, jr: Pseudo-Direct c) sltii: immediate, beq: PC-relative, jr: PC-relative d) sti: base, beq: immediate , jr: Pseudo-Direct e) slti: register, beq: base, jr: Pseudo-Direct f) siti: immediate, beq: Pseudo-Direct.jr: PC-relative g) sti: immediate, beq: base.jr: PC-relative h) slti: immediate, beg: PC-relative , jr: Pseudo-Direct Answer 2: (Note: Indicate ONLY the LETTER corresponding to your choice) Part 3: For the MIPS program above, what is the machine code representation of: beq Sao, $zero, EXIT a) Ox14800003 b) Ox14800002 c) Ox1480000C d) Ox10800003 e) Ox1080000C f) Ox1040000C Answer 3: (Note: Indicate ONLY the LETTER corresponding to your choice) Part 4: For the MIPS program above, what is the machine code representation of: jal label a) OxOc002710 b) Ox08002710 c) Ox08040000 d) Ox0c010000 e) OxOc040000 f) Ox0c000000 Answer 4: (Note: Indicate ONLY the LETTER corresponding to your choice) Part 5: What is the MIPS assembly language statement corresponding to this machine language? ad2804b0hex a) sw $t0,1200($t1) b) sw $s1,1200($50) c) Ibu $50.24($51) d) sb $50,1200($51) e) ori Sto, t1, 1200 f) addito.t1. 1200 B) andi so, s1, 1200 h) Ihu St0,1200($t1) Answer 5: (Note: Indicate ONLY the LETTER corresponding to your choice)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
