计算机组成原理 Expanding Opcode
计算机组成原理 Expanding Opcode
Consider a machine with 16-bit instructions.The following formats are designed
Opcode only (zero address)
Opcode + 1 address
Opcode + 2 addresses
The size of address field is 4 bits.One shorter opcode is reserved for the expanding opcode.
How many 0-addesss,1-address and 2-address instructions can be formulated?
3-address instructions:
0000 xxxx yyyy zzzz
0001 xxxx yyyy zzzz
0010 xxxx yyyy zzzz
.
.
.
1101 xxxx yyyy zzzz
1110 xxxx yyyy zzzz
2-address instructions:
1111 0000 yyyy zzzz
1111 0001 yyyy zzzz
.
.
.
1111 1100 yyyy zzzz
1111 1101 yyyy zzzz
1-address instructions:
1111 1110 0000 zzzz
1111 1110 0001 zzzz
.
.
.
1111 1111 1101 zzzz
1111 1111 1110 zzzz
3-address instructions是从0000至1110.
那为什么2-address instructions是从1111 0000 - 1111 1101而不是从1111 0000 - 1111 1110呢?