Академический Документы
Профессиональный Документы
Культура Документы
Instruction Formats
Instruction format:
A computer will usually have a variety of instruction of instruction code
formats.
It is the function of the control unit within the CPU
to interpret each instruction code and
provide necessary control functions needed to process the instruction.
The format of the instruction is the bits of the instruction as they appear
in memory words or in a register.
The bits of the instructions are divided into groups called fields.
Instruction Format
INSTRUCTION FORMAT
Instruction Fields
OP-code field - specifies the operation to be performed
Address field - designates memory address(s) or a processor register(s)
Mode field
- specifies the way the operand or the
effective address is determined
The number of address fields in the instruction format
depends on the internal organization of CPU
- The three most common CPU organizations:
Single accumulator organization:
ADD
X
/* AC AC + M[X] */
General register organization:
ADD
R1, R2, R3
/* R1 R2 + R3 */
ADD R1, R2
/* R1 R1 + R2 */
MOV R1, R2
/* R1 R2 */
ADD R1, X
/* R1 R1 + M[X] */
Stack organization:
PUSH X
/* TOS M[X] */
ADD
Instruction Formats
The 4-address instruction, hardly ever seen, also allows the address
of the next instruction to specified explicitly.
Instruction Format
Bits
24
Which Where to
operation put result
24
24
24
Where to find
next instruction
3-Address Instruction
3-Address instruction:
Address of next instruction kept in processor state registerthe PC
(Except for explicit Branches/Jumps)
Rest of addresses in instruction
2-address Instruction :
Result overwrites Operand 2
Needs only 2 addresses in instruction but less choice in placing data
1-Address Instruction
1-address Instruction :
Special CPU register, the accumulator, supplies 1 operand and stores result
One memory address used for other operand
Need instructions to load and store operands:
LDA OpAddr
STA OpAddr
0-Address Instruction
References
Computer System Design and ArchitectureVincent P. Heuring - page 40-46 second edition