Question
This problem is adapted from an earlier edition of P&H. Consider the following code used to implement the instruction: foo $s0,$s1,$s2 mask: .word 0xFFFFF83F start:
This problem is adapted from an earlier edition of P&H.
Consider the following code used to implement the instruction:
foo $s0,$s1,$s2
mask: .word 0xFFFFF83F
start: la $t0,mask
lw $t0,0($t0)
la $s0,shftr
lw $s0,0($s0)
and $s0,$s0,$t0
andi $s2,$s2,0x1f
sll $s2,$s2,6
or $s0,$s0,$s2
la $t5,shftr
sw $s0,0($t5)
shftr: sll $s0,$s1,0
Add meaningful comments to the code and write a paragraph describing how it works. Why do you suppose that writing self-modifying code such as this is a bad idea (and often times not actually allowed)?
Please clearly explain it. thank you.
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