Professional Documents
Culture Documents
CENTRAL PROCESSING
UNT
ECEg3148 01/06/22
2 Lecture Outline
• Instruction Formats
Three address instructions
Two address instructions
One address instructions
Zero address instructions
01/06/22
An instruction set
The complete collection of instructions that are
understood by a CPU.
Serves as an interface between software and hardware.
Provides a mechanism by which the software tells the hardware
what should be done.
Instruction Set Design
One important design factor is the number of operands contained
in each instruction
Has a significant impact on the word size and complexity of the CPU
General Other
Purpose Stack
ALU
ALU
AC Registers ALU
Registers
Registers
memory
Joanne E. DeGroat, OSU memory
acc = acc + mem[C] R1 = R1 + mem[C] R3 = R1 + R2
NUMBER OF ADDRESSES
9
Program to evaluate X = (A + B) * (C + D) :
Program to evaluate X = (A + B) * (C + D) :
MOV R1, A /* R1 M[A] */
ADD R1, B /* R1 R1 + M[B] */
MOV R2, C /* R2 M[C] */
ADD R2, D /* R2 R2 + M[D] */
MUL R1, R2 /* R1 R1 * R2 */
MOV X, R1 /* M[X] R1 */
LOAD A /* AC M[A] */
ADD B /* AC AC + M[B] */
STORE T /* M[T] AC */
LOAD C /* AC M[C] */
ADD D /* AC AC + M[D] */
MUL T /* AC AC * M[T] */
STORE X /* M[X] AC */
Operand
Pointer to operand
Operand
Operand
Registers
Registers
Indexed Addressing
A = base, R = displacement
EA = A + R
Good for accessing arrays
EA = A + R
R++
These are the values loaded into the accumulator for each addressing mode.