The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I need help solving the attached worksheet. Especially when it comes to the location counter and program counter. I don't understand how either of them work in cases with BNE or JR.
Â
Â
MIPS Assembly Workshop - 2017 This workshop exercise is to allow you to practice your skills at the
art of assembling MIPS Assembly Language program code. The following page has a small copy routine written in MIPS Assembly
Language. Please fill in the spaces in the table as my example shows:
Please use decimal values for the OpCode row, and Hex digits for the
Instruction row. Use your Green Card to lookup the required values. Location
Counter Program
Counter
BEQ $t4, OpCode Rs Rt Offset or immediate value 4 12 23 Offset from Program Counter to Fini 24 Instruction: $s7 Fini # Branch when equal (Calculation based on location of Fini) 1 1 9 7 (offset to Fini) [Use Hex digits] 28 Additionally, use the Left margin to keep track of the Location
Counter, and the right margin to note the value that would be in the
Program Counter.
The initial value of the Location Counter should be zero.
The first instruction below is worked. OpCode
LC ADDI
8 $rs $rt $v0, $zero,
2 0 0 $rd
0 # Initialize counter PC 0 2002 0000
loop: 4 LW $v1, 0 ($a0) # read the next
source word SW $v1, 0 ($a1) # copy to the
destination ADDI $v0, $v0, 1 # count the copied
word ADDI $a0, $a0, 4 # the next source
word ADDI $a1, $a1, 4 # move destination
pointer loop # next, if not zero
value 4 BNE $v1, $zero, JR $ra # return to caller
-----------