In: Computer Science
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
solution:
given data:
Assume that the program counter (PC) :
j and jal instructions:
Format Opcodes
op
31-26 |
target
25-0 |
Instruction | Opcode | Target | |
---|---|---|---|
j | label | 000010 | coded address of label |
jal | label | 000011 | coded address of label |
JR instruction:
The sample JR instruction demonstrated in the datapath above is JR $13.
The instruction's equivalent in binary is:
(opcode) (rs) (rt) (rd) (shamt) (funct)
000000 01101 00000 00000 00000 001000
BNE instrction:
In the event that the Z banner of the CCR is clear, the destination operand will be added to the PC, and the 68k will keep perusing at the new balanced held in PC. If the Z banner is set, the guidance is disregarded.
beq instruction:
It's linguistic structure is:
BEQ $first source register's location, $second source register's location, branch esteem.
The example BEQ guidance showed in the datapath above is BEQ $9, $11, .
The guidance's identical in binary is:
(opcode) $rs $rt (offset)
000100 01011 01011
please give me thumb up