Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MPLAB PIC 32 Question 3 for HW 2 The program below contains several comments (all of which start with ) describing an operation to be
MPLAB PIC 32
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, SHIPS, OR ROTATE INSTRUCTION SOME OF THE INSTRUCTIONS LISTED BELOW ACTUALLY REQUIRE MULTIPLE INSTRUCTIONS THESE LINES HAVE BEEN MARKED, AND YOU ARE ALLOWED TO USE >I 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 vl: V2: .data . Word .word 12 OXFEEDABEE .text noreorder main .ent main lv si, vi Ss1 - v1 lv $32, v2 ## $s2 - 2 ***REQUIRES >1 INSTRUCTION** Sto - v2 with lowest 12 bits cleared (set to 0), other bits staying the same ***REQUIRES >1 INSTRUCTION $t1 - v2 with a highent bits set to o, other bits staying the same St2 - vi multiplied by 8 *vithout using a multiply instruction **REQUIRES >I INSTRUCTION **: St3 - V2 multiplied by 12 without sing a multiply instruction St4 - vl divided by 2 without using a divide instruction $5 - v2 with the lowest 16 bits flipped (inverted) and the upper 16 bits staying the same ***REQUIRES >1 INSTRUCTIONS - OXFD000010 without using the 11 pseudo-instruction This code simply loope infinitely pint 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, SHIPS, OR ROTATE INSTRUCTION SOME OF THE INSTRUCTIONS LISTED BELOW ACTUALLY REQUIRE MULTIPLE INSTRUCTIONS THESE LINES HAVE BEEN MARKED, AND YOU ARE ALLOWED TO USE >I 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 vl: V2: .data . Word .word 12 OXFEEDABEE .text noreorder main .ent main lv si, vi Ss1 - v1 lv $32, v2 ## $s2 - 2 ***REQUIRES >1 INSTRUCTION** Sto - v2 with lowest 12 bits cleared (set to 0), other bits staying the same ***REQUIRES >1 INSTRUCTION $t1 - v2 with a highent bits set to o, other bits staying the same St2 - vi multiplied by 8 *vithout using a multiply instruction **REQUIRES >I INSTRUCTION **: St3 - V2 multiplied by 12 without sing a multiply instruction St4 - vl divided by 2 without using a divide instruction $5 - v2 with the lowest 16 bits flipped (inverted) and the upper 16 bits staying the same ***REQUIRES >1 INSTRUCTIONS - OXFD000010 without using the 11 pseudo-instruction This code simply loope infinitely pint apin nop end main Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started