Question: Do the following well. It is not much, read the directions, do the comments as asked and do the explanations seperate to the comments asked.
Do the following well. It is not much, read the directions, do the comments as asked and do the explanations seperate to the comments asked. Write meaningful comments of the code given based on the instruction given and then write the descriptions as stated.
Consider the following code used to implement a new instruction: foo $t$t$t:
This is the code:
mask : word xFFFFFF
s t a r t : l a $t mask
lw $t $ t
l a $t s h f t r
lw $t $ t
and $t $t $ t
andi $t $t x f
s l l $t $t
o r $t $t $ t
l a $t s h f t r
sw $t $ t
s h f t r : s l l $t $t
Above is the code, make sure it is formatted correctly when you send the comments etc. Following is the full directions:
Add meaningful comments to the code and write a brief sentence max description of what foo does. This is not the same as saying how it does it eg when asked to describe what a pedestrian is doing, you would say they are walking, not that they are ilfting their left leg, angling it forward, putting it down, State at least one reason why writing selfmodifying code such as this is a bad idea and often times not actually allowed by the operating system
Some additional explanatory notes:
Recall that labels are just humanreadable names of bit immediates corresponding to the address that the OS will decide for them. For example, if the OS decides to start the program at xABCD mask is the bit immediate xABCD In this case, the program does the same thing regardless of what the OS decides such programs are said to be relocatable but all programs may not be
relocatable
the la pseudoinstruction stores the bit label see previous note into a
register. It is equivalent to li though some assemblers might not allow a label argument for li
The word directive yet has not been covered, This is an assembler directive, which is essentially an instruction to the assembler NOT an assembly language instruction In this case, it tells the assembler to reserve a word of memory initialized to xffffff Mask is the address of this word just as start is the address of the word in memory containing the machine code for that la instruction
All directions and what you need above is there, do the comments and the explanation well. follow it well
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
