CSC316 Assignment AKPOS
CSC316 Assignment AKPOS
MATNO: PSC2006252
CSC316: DIGITAL COMPUTER DESIGN
QUESTION: Write on the four different types of address instructions
1. ZERO-ADDRESS INSTRUCTIONS
Zero address instructions are instructions that are called by just specifying the op-code only, i.e. they do
not require the address to be specified, hence the name zero address. They operate on data that is
already stored in registers or memory locations implicitly defined by the instruction. These instructions
expect their input/output data to be aready stored in a specified location. They are also called stack
instructions. Examples of such instructions include AAA, AAD.
Advantages
1. They are simple and can be executed quickly since they do not require operand fetching and
addressing
2. Their programs are usually shorter as they require less writing
3. They take up small memory space
Disadvantages
1. The instructions usually require many bits, resulting in extensive programs
2. They are usually difficult to debug as their operands are not specified in their instructions.
2. ONE-ADDRESS INSTRUCTIONS
As the name implies, these types of instructions have only one address specified in the instruction.
They are called by specifying just one operand/address, which is typically a memory location or a
register. An example is the INC instruction which adds 1 to the value of its operand, as in INC AX.
These instructions may not only operate on one operand, if another operand is required, it is usually
implicitly defined.
Advantages
1. They are easier to debug as their operands are specified in the instruction.
2. They are more compact and faster than two or three-address instructions.
Disadvantages
1. The number of instructions needed to evaluate an arithmetic expression is much more compared
to two and three-address instructions.
2. They offer less flexibility
3. TWO-ADDRESS INSTRUCTIONS
Two address instructions as their name imply, are instructions that require two operands to be specified
alongside the op-code. They are by far the most common type of instructions. Arithmetic instructions
are usually of this type. Their syntax is usually of the following form:
OPCODE OPERAND, OPERAND
Examples are MOV, ADD, SUB, XCHG etc.
Advantages
1. They allow for shorter instructions and faster instruction fetch.
2. They provide faster memory access to operands.
Disadvantages
1. They have very limited address mode space.
2. Using multiple operands can improve performance, but they also complicate the instructions.
4. THREE-ADDRESS INSTRUCTIONS
Three-address instructions require three operands to be specified in the instructions, the operands may
be registers or memory locations. These instructions operate on the contents of all three operands and
others if necessary, and the result may be stored in one of the operands. The syntax for these types of
instructions is usually OPCODE OPERAND, OPERAND, OPERAND.
Advantages
1. They produce short and simple programs for evluating mathematical expressions.
2. They require less execution time
Disadvantages
1. Many bits are needed for instructions encoded in binary to define addresses.
2. More advanced processing and encoding circuits are needed for these instructions.