Question

In: Computer Science

Please give full explanation. Assume that the program counter (PC) is set to 0x00000000. Describe how...

Please give full explanation.

Assume that the program counter (PC) is set to 0x00000000. Describe
how each of the instructions below could be used to set the next value of PC to 0x0FFFFFFC.

j, beq, jr, jal, bne

Solutions

Expert Solution

J - The jump instruction causes the content of the PC to change to the address given in the instruction. Therefore, all we need to do is the following to change the content of the PC:

j 0x0FFFFFFC

BEQ - This instruction checks the zero flag and if it is set to 1, then beq will cause a jump to an address given in the instruction. So, to set PC to 0x0FFFFFFC, we will set the zero flag to 1 and execute the following:

BEQ 0x0FFFFFFC

JR - This instruction loads into the PC the address stored in register $ra. Hence, to set PC to 0x0FFFFFFC, we need to load 0x0FFFFFFC to $ra and then call JR, using the following:

LOAD $ra 0x0FFFFFFC

jr $ra

JAL - JAL branches the PC to a given subroutine address and stores the address to the instruction next to jal in $ra for the PC to return after completing the subroutine.

So, to set PC to 0x0FFFFFFC, we need to execute the following:

JAL 0x0FFFFFFC

BNE - This instruction branches to a given address if the two registers given to it does not contain equal values.

So,

LOAD r1 4

LOAD r2 8

BNE r1 r2 0x0FFFFFFC

This will change the PC to 0x0FFFFFFC.


Related Solutions

Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions...
Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions below could be used to set the next value of PC to 0x0FFFFFF4 j, jr, bne, jal, beq
Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump...
Suppose the program counter (PC) is set to 0x30002000. Is it possible to use the jump (j) MIPS assembly instruction to jump directly to the instruction at 0x50003000? If yes, write the corresponding assembly instruction(s). If not, explain why and give other MIPS instruction(s) that can jump to this target address. (For this problem, assume that the instruction memory starts from 0x00000000 and goes to 0xFFFFFFFF.)
Suppose the program counter (PC) is set to 0x2000FFFC. Is it possible to use the jump...
Suppose the program counter (PC) is set to 0x2000FFFC. Is it possible to use the jump (j) MIPS assembly instruction to jump directly to the instruction at 0x10003000? If yes, write the corresponding assembly instruction(s). If not, explain why and give other MIPS instruction(s) that can jump to this target address. (For this problem, assume that the instruction memory starts from 0x00000000 and goes to 0xFFFFFFFF.)
*** Please be concise and give full explanation *** What kinds of evidence do scientists use...
*** Please be concise and give full explanation *** What kinds of evidence do scientists use to categorize and classify living things?
*** Please be concise and give full explanation *** Compare and contrast the protein-first versus RNA-first...
*** Please be concise and give full explanation *** Compare and contrast the protein-first versus RNA-first hypotheses. Which hypothesis has the most supporting evidence?
Discuss unemployment and how it is measured. Please give a detailed explanation.
Discuss unemployment and how it is measured. Please give a detailed explanation.
Provide explanation about Iterations. Give examples and write a program.
Provide explanation about Iterations. Give examples and write a program.
Please give a detailed explanation how to solve this with excel 1)This problem demonstrates a possible...
Please give a detailed explanation how to solve this with excel 1)This problem demonstrates a possible (though rare) situation that can occur with group comparisons. The groups are sections and the dependent variable is an exams score. Section 1 Section 2 Section 3 84.9 58.5 74.1 70.6 57.6 81.5 76.4 65.8 74.9 62.5 84.1 79 81.2 80.5 72.3 67.5 44.4 65.8 75.5 68.6 71 68.6 41.8 67.8 79.2 64.8 75.5 Run a one-way ANOVA (fixed effect) with α=0.05α=0.05. Round the...
How would a financial manager determine optimal capital structure? Please give a detailed explanation. How this...
How would a financial manager determine optimal capital structure? Please give a detailed explanation. How this would fit in with the company's capital expenditures, growth plans and operating results? Please provide examples. Please keep in mind that inadequate answers that already exist on the web.
Please Give the Full Answers Company: Wal-Mart (write on the following guidline) 1. Describe the process:...
Please Give the Full Answers Company: Wal-Mart (write on the following guidline) 1. Describe the process: list the key tasks performed and sequence of steps, people involved, equipment used, environmental conditions, work methods, and materials used. 2. Describe the players: external and internal customers and suppliers, and process operators. 3. Define customer expectations: what the customer wants, when, and where, for both external and internal customers. 4. Determine what historical data are available on process performance, or what data need...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT