Reference no: EM13168151
The MIPS architecture reserves register 0 (called $zero) to be always equal to 0. This allows synthesizing additional addressing modes and additional instructions from the instruction set.
The 'load' instruction in MIPS that transfers data from the memory to a register supports only the 'base
with displacement' addressing mode. This is the format of the 'lw' (load word) instruction:
lw <reg>, <imm>(<reg>)
An example is: lw t0, 12(s0)
the data in the memory at address (s0+12) is copied into register t0.
Part a) Show how the addressing mode above can be used as the 'direct addressing' mode.
Part b) Show how the addressing mode above can be used as the 'register indirect addressing' mode.
Part c) Show how the register $zero can be used to synthesize a 'mov' instruction from the 'add'
instruction. The 'mov' instruction copies one register into another. The 'mov' instruction will then be a
pseudoinstruction. (Syntax: mov <reg>, <reg> add <reg>, <reg>, <reg>)
Part d) Show how the register $zero can be used to synthesize a 'li' (load immediate) instruction from the
'addi' (add immediate) instruction. The 'li' instruction loads an immediate number in a register. (Syntax:
li <reg>, <constant> addi <reg>, <reg>, <constant>)
Part e) In your opinion, do the uses above justify reserving a register to be always equal to zero?
Evaluate a user''s expression
: Write a function that will evaluate a user's expression. It should call the getExpression function that you previously wrote to get the expression to evaluate from the user. You should evaluate the expression step-by-step.
|
Calculate the celsius equivalent of a fahrenheit temperature
: Construct a program that allows you to calculate the Celsius equivalent of a Fahrenheit temperature.
|
Create an application in which a user can enter a phone book
: Create an application in which a user can enter a phone book entry, including the following elements: First Name, Last Name, Phone Number, email address
|
The contenders are tortoise and hare
: The contenders are Tortoise and Hare, and they begin race as investors at "tile 1" of 70 tiles The finish line is at 70 the tile. With each tick of the clock
|
The mips architecture reserves register
: The MIPS architecture reserves register 0 (called $zero) to be always equal to 0. This allows synthesizing additional addressing modes and additional instructions from the instruction set.
|
Calculates the position of a cannonball
: Write a c++ program that calculates the position of a cannonball that is fired straight up in the air. Use short time intervals (.01 seconds) and display the position and velocity every second.
|
Indicate the changes
: Indicate the changes (using the shorthand representation) that you would need to make to the original Premiere Products database design to support the following requirements. There is no relationship between customers and sales reps. When a custo..
|
You can push multiple operands on the stack
: You can push multiple operands on the stack. The operation will always use the two topmost values. For example, to evaluate (A+B+C), you can use the code below:
|
Pattern matching
: Question 1 In sed, when you do pattern matching, the largest pattern is always matched first, left to right.
|