Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 for HW 2 The program below contains several comments (all of which start with ) describing an operation to be performed on one

image text in transcribed
Question 3 for HW 2 The program below contains several comments (all of which start with ) describing an operation to be performed on one or more of the variables declared at the start of the program. Replace each comment with one appropriate instruction to complete the program (or, as I've done below, simply move each conment to the right of the instruction) ## EACH INSTRUCTION YOU USE MUST BE A BITWISE, SHIFT, OR ROTATE INSTRUCTION SOME OF THE INSTRUCTIONS LISTED BELOW ACTUALLY REQUIRE MULTIPLE INSTRUCTIONS THESE LINES HAVE BEEN MARKED, AND YOU ARE ALLOWED TO USE >1 INSTRUCTION FOR EACH ONE OF THE MARKED LINES (THE LINES THAT CHANGE Sto, $t1, AND $t6) This program gives you some practice working with bitwise, shift, and rotate operators .global main vi: V2: .data .word .word 12 OXFEEDABEE .text Set .ent noreorder main: $31, vi Ss1 - v1 ly $32, v2 # $s2 - 2 ***REQUIRES >1 INSTRUCTION** Sto - v2 with lowest 12 bita cleared (set to 0), other bits staying the same REQUIRES >1 INSTRUCTION** $t1 - v2 with highent bits set to o, other bits staying the same St2 - vi multiplied by 8 *vithout using a multiply instruction ***REQUIRES > INSTRUCTION St3 - V2 Multiplied by 12 without using a multiply instruction $t4 - vi divided by 2 vithout using a divide instruction w $t5 - v2 with the lowest 16 bits flipped (inverted) and the upper 16 bits staying the same ***REQUIRES >1 INSTRUCTION** $t - OXFDO00010 without using the 11 pseudo-instruction This code simply loopo infinitely apint apin nop end main Question 3 for HW 2 The program below contains several comments (all of which start with ) describing an operation to be performed on one or more of the variables declared at the start of the program. Replace each comment with one appropriate instruction to complete the program (or, as I've done below, simply move each conment to the right of the instruction) ## EACH INSTRUCTION YOU USE MUST BE A BITWISE, SHIFT, OR ROTATE INSTRUCTION SOME OF THE INSTRUCTIONS LISTED BELOW ACTUALLY REQUIRE MULTIPLE INSTRUCTIONS THESE LINES HAVE BEEN MARKED, AND YOU ARE ALLOWED TO USE >1 INSTRUCTION FOR EACH ONE OF THE MARKED LINES (THE LINES THAT CHANGE Sto, $t1, AND $t6) This program gives you some practice working with bitwise, shift, and rotate operators .global main vi: V2: .data .word .word 12 OXFEEDABEE .text Set .ent noreorder main: $31, vi Ss1 - v1 ly $32, v2 # $s2 - 2 ***REQUIRES >1 INSTRUCTION** Sto - v2 with lowest 12 bita cleared (set to 0), other bits staying the same REQUIRES >1 INSTRUCTION** $t1 - v2 with highent bits set to o, other bits staying the same St2 - vi multiplied by 8 *vithout using a multiply instruction ***REQUIRES > INSTRUCTION St3 - V2 Multiplied by 12 without using a multiply instruction $t4 - vi divided by 2 vithout using a divide instruction w $t5 - v2 with the lowest 16 bits flipped (inverted) and the upper 16 bits staying the same ***REQUIRES >1 INSTRUCTION** $t - OXFDO00010 without using the 11 pseudo-instruction This code simply loopo infinitely apint apin nop end main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions