You are on page 1of 9

Introduction

An instruction is normally made up of a


combination of an operation code and some
way of specifying an operand, most
commonly by its location or address in
memory though non memory reference
instructions can exist.
The most common fields found in
instruction formats are:
- An operation code
- An address field
- A mode field

Types of Computer Instructions


Four address instruction
Three address instruction
Two address instruction
One address instruction
Zero address instruction

Four Address Instructions


The instruction specifies the addresses of
operands in memory, the address where
result is stored and also the address
where the next instruction to be carried
out is stored.
For example: ADD P,Q,R,S

Three Address Instructions


The instruction specifies three addresses. In
these fields, either a processor register or
memory operand can be specified.
For example: ADD R1,R2,R3 implies
R1 R2+R3

One Address Instruction


The availability of an accumulator register in
a processor allows intermediate results to be
kept in it and subsequently used without
unnecessary storing and retrieving from the
memory. Then only one address is sufficient.

For example:ADD B implies AC [AC]+[B]

Zero Address Instruction


There are instructions where the
location of operands is defined implicitly.
The operands are stored in a stack. Stack
is a sequence of memory locations where
data can be inserted and deleted from
only one end called the Top of the stack.
For example: PUSH A pushes A on to
the top of the stack, POP Y deletes an
element from the top of the stack.

Addressing Modes
The instruction cycle is divided into 3
major phases:
1. Fetch the instruction from memory
2. Decode the instruction
3. Execute the instruction

Conclusion
A computer has variety of instruction
code formats. The control unit in the
CPU interprets each instruction code
and provides the necessary control
functions needed to process the
instruction.

You might also like