No. Addresses are 32-bit patterns, machine instructions are 32-bit
patterns, and many data are 32-bit patterns.
There is no way to tell them apart, except by context.
Here is an example. Say that this bit pattern got fetched
as an instruction: 0x00000000.
Is this the address of the first byte of memory,
or the sll $0,$0,0
The following program illustrates the jump instruction. For simplicity, all instructions other than the jump instruction are no-ops. The jump instruction jumps to the first instruction of the program. The very last instruction fills the delay slot.
Address Machine Instruction Assembly Instruction 00400000 0000 0000 0000 0000 0000 0000 0000 0000 sll $0,$0,0
00400004 0000 0000 0000 0000 0000 0000 0000 0000 sll $0,$0,0
00400008 0000 0000 0000 0000 0000 0000 0000 0000 sll $0,$0,0
0040000C 0000 0000 0000 0000 0000 0000 0000 0000 sll $0,$0,0
00400010 000010 00 0001 0000 0000 0000 0000 0000 j firstInstruction
00400014 0000 0000 0000 0000 0000 0000 0000 0000 sll $0,$0,0
The left-most six bits of the j
machine instruction are the opcode.
You need to decide if the next 26 bits are correct.
1. | Write the full 32-bit jump address: 0x00400000 | ______________________________ |
2. | Write the 26-bit field of the jump instruction: | _________________________ |
3. | Shift it left two positions: | ___________________________ |
4. | What are the high-order four bits of the PC? | ____ |
5. | Copy (4) to the left of (3): | ____ ___________________________ |
6. | Is (5) the same as (1)? | _____ |