100 What highlevel languages call goto is usually called a j

100% What high-level languages call goto is usually called a jump instruction in assembly language. The catch is that you can\'t have a 6 bit opcode and a 32-bit (immediate) memory address fit in one 32-bit instruction MIPS handles this a little strangely, so let\'s make a more normal jump instruction called jBp, which takes two words. The first, s the metrication with the opcode, the second is just the 32-bit jump target address. Thus, jmp 0 times12345678 would be encoded as two words: oxfc000000 and 0x12345678. Executing that instruction would make the next instruction be taken from memory address 0x12345678. Add states to the following to implement the jmp instruction, when Oxfc000000 op() Jmp Start: PCout, MARIn, MEMread, Yin CONST(4). ALUadd. Zin. UNTILmfc MDRout, iRm Zout, PCin, JUMPonop HALT I* Should erxJ nere on undecoded cp */Jmp:

Solution

when 0xfo00000op() Jmp

Start:
PCout, MARin, MEMread, Yin
CONST(4), ALUadd, Zin, UNTILmfc
MDRout, IRin
Zout, PCin, JUMPonop
HALT /* Should end here on undecoded op */

Jmp :
PCout, MARin, MEMread
UNTILmfc
MDRout, PCin, JUMP(Start)

 100% What high-level languages call goto is usually called a jump instruction in assembly language. The catch is that you can\'t have a 6 bit opcode and a 32-b

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site