Question

If you need to keep the value held in $1, what is a safe way to...

If you need to keep the value held in $1, what is a safe way to call the subroutine other that might use this register, i.e what do you need to do before (and after) you jal other?

Homework Answers

Answer #1

There are two ideas behind a subroutine.

  1. You should be able to call the subroutine from anywhere.
  2. Once the subroutine is complete, it should return back to the place that called the subroutine.

For making a subroutine call is jal which means "jump-and-link".

jal takes a label as its operand. This label is an address in memory for a subroutine. The assembler translates the label to an address.

To jump to that address really means to update the PC (program counter) to the address of the subroutine. The PC is a hidden register that holds the address of the current instruction being run.

The jal instruction saves the return address in register $r31. This register is also called $ra (where "ra" means return address).

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
what should you do if the member is not safe (>1)? Provide three things to do...
what should you do if the member is not safe (>1)? Provide three things to do and why what should i do to make a beam or a column safe ? For example increase or decrease the section because .... i need three things
How do healthcare providers(e.g. Hospital,emergency department,personal physician,nurse practitioner,therapist,pharmacist) keep you safe from being harmed by the...
How do healthcare providers(e.g. Hospital,emergency department,personal physician,nurse practitioner,therapist,pharmacist) keep you safe from being harmed by the effects of healthcare services?what could your providers do better to keep you safe?
What is cash only accounting and what records do you need to keep for it? NO...
What is cash only accounting and what records do you need to keep for it? NO HAND WRITTEN ANSWERS PLEASE
You currently have $1,440,000 of wealth, which you keep in the form of two assets: a...
You currently have $1,440,000 of wealth, which you keep in the form of two assets: a bank account worth $1,400,000 and $40,000 in cash in your home safe. However, while you are confident that your home safe is secure, you are concerned that there is a probability ?>0 that your bank will fail (i.e., declare bankruptcy), in which case you would lose all the money in your bank account. (Assume this is the only bank available to you.) The von...
1) What considerations do you need to be aware of before you recognize and reward an...
1) What considerations do you need to be aware of before you recognize and reward an employee? (2) What are some awards/rewards you would like to use to recognize an engaged employee?
As you all know,The only constant thing in the world is Change. We need to keep...
As you all know,The only constant thing in the world is Change. We need to keep changing in order to grow further and to achieve success on a continuous basis. Moving forward, we have decided to bring about certain changes in the organizational structure. The organization is moving from a flat structure to a tall structure as the handling of subordinates and giving proper attention on each has become little difficult. The best way to implement the change is to...
What variables will you keep the same in this experiment? Check off the items in this...
What variables will you keep the same in this experiment? Check off the items in this list that you would use for this experiment. You may add any items you feel you would need. Skim milk (which contains lactose) Lactase drops Graduated cylinder Eye dropper Ice cubes pH paper Hot plate Mixing spoon Thermometer Vinegar (acidic) Test tubes Glucose test strips Baking soda (basic) Other items you feel you would need to use for this experiment. Describe what you would...
What is the difference between future value and present value? What data do you need to...
What is the difference between future value and present value? What data do you need to do a future value or present value calculation?
In your own words 1. There is a concept called “creative destruction” that is introduced in...
In your own words 1. There is a concept called “creative destruction” that is introduced in this chapter. Can you think of a process in nature in which it is necessary to destroy something prior to creating something new? Can you see any way that certain elements in the economy need to be destroyed so that other things can flourish? 2. The current chapter is concerned with regulating markets. Why might it be difficult to regulate a market? Do you...
You are managing a pension fund with a value of $410 million and a beta of...
You are managing a pension fund with a value of $410 million and a beta of 1.86. You are concerned about a market decline and wish to hedge the portfolio. You have decided to use SPX calls. How many contracts do you need if the delta of the call option is 0.62 and the S&P Index is currently at 1,230? How do you find the number of contracts using Excel? I keep getting the wrong answer using a calculator Contracts
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT