3 bit is used for opcode part. Memory reference instruction uses 12 bit for addressing part. 1 bit for addressing mode. For direct address most significant bit is set to zero and for indirect address MSB is set to one
Zero address instructions
One address instructions
Two address instructions
Three address instructions
IT does not use any address field in the computational instruction
ADD and MUL instruction don’t use any address field of the stack (set of memory location); however, address field is necessary for PUSH and POP instruction
THE instruction with one address format use only one address field.
IT use accumulator (AC) register for all types of data manipulation
THE instructions with two address format uses two address fields.
Each address field can specify a register or a memory location.
example are: ADD, MOV , CMP, BIS etc.
The various formats for specifying operand are called addressing modes.
Immediate/Implied addressing mode
Register addressing mode
Register Indirect
Auto Increment / Auto decrement
Direct addressing mode
Indirect addressing mode
Relative addressing mode
Index addressing mode
Immediate/Implied addressing mode
Register addressing mode
Register Indirect
Auto Increment / Auto decrement
Direct addressing mode
Indirect addressing mode
Relative addressing mode
Index addressing mode
Base Register addressing mode
1. ATAL BIHARI VAJPAYEE VISHWAVIDYALAYA
DEPARTMENT OF COMPUTER SCIENCE & APPLICALION
SUBMITTED BY
UJJWAL MATOLIYA
2. Instruction Definition
3 bit is used for opcode part. Memory reference
instruction uses 12 bit for addressing part. 1
bit for addressing mode. For direct address
most significant bit is set to zero and for
indirect address MSB is set to one
OR
An instruction is a single operation of a
processor defined by the processor
instruction set.
Ex :- I opcode operand
3. Instruction are categorized into different
format with respect to the operand fields in
the instruction
Zero address instructions
One address instructions
Two address instructions
Three address instructions
4. Zero address instructions
IT does not use any address field in the
computational instruction
ADD and MUL instruction don’t use any
address field of the stack (set of memory
location); however, address field is
necessary for PUSH and POP instruction
5. Ex. X=(A+B)*(C+D)
PUSH A M[SP] A
PUSH B M[SP] B
ADD M[SP] A+B
PUSH C M[SP] C
PUSH D M[SP] D
ADD M[SP] C+D
MUL M[SP] (A+B)*(C+D)
POP X M[X] M[SP]
6. ONE address instructions
THE instruction with one address format use
only one address field.
IT use accumulator (AC) register for all types
of data manipulation
7. EX. X=(A+B)*(C+D)
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]
8. Two address instructions
THE instructions with two address format
uses two address fields.
Each address field can specify a register
or a memory location.
example are: ADD, MOV , CMP, BIS etc.
10. Three address instructions
o THE instruction with three address format
uses three address field.
o Each address field can specify a register or a
memory location.
o A program with arithmetic produces fast and
better results.
14. Immediate Addressing Mode
In this mode data is present in address field of
instruction. Designed like one address
instruction format.
EX:-
Opcode Address
DATA IS DIRECTLY STORED
HERE
15. Register Mode
In register
addressing the
operand is placed
in one 8bit or 16
bit general
purpose register.
The data is in the
register that is
specified by the
instruction.
R
operand
Register
Instruction
16. Register Indirect Mode
In this addressing the oprand’s
offset is placed in any one of the
register BX, BP, SI, Di, as
specified in the instruction. The
effective address of the data is in
the base register or an index
register that is specified by the
instruction . here two register
reference is required to access
the data.
opcode Register
ADD
REGISTER(
Effective ADD)
Memory
(DATA)
17. Direct Addressing Mode
In the direct addressing mode address of the
operand is given in the instruction and data
is available in the memory location which is
provided in instruction. we will move this
data in desired location.
Opcode address
Operand
INSTRUCTION
MEMORY
18. Indirect Addressing Mode
In the indirect addressing mode address field of
instruction contains the address of effective address.
Here two reference are required
1st reference to get effective address
2nd reference to access the data
Opcode
xx786
INSTRUCTION
Eff.
ADD
24
MEMORY
19. Auto Increment addressing mode
• Effective address of the operand is the contents of a
register specified in the instruction. After accessing
the operand the content of this register are
automatically incremented to point to the next
consecutive memory location
Opcode
R1
R3
R2
R1(EFF.
ADD)300
R0
REGISTER
301
MEMORY
INSTRUCTION
20. Auto Decrement Addressing Mode
o Effective address of the operand, the content of this
register are automatically decremented to point to
the previous consecutive memory location. Here
one register reference one memory reference and
one ALU operation is required to access the data.
INSTRUCTION
OPCODE R1
REGISTER
R3
R2
R1(EFF.
ADD)300
R0
MEMORY
299
21. Base Register addressing Mode
In this addressing mode effective address of the
operand is obtained by adding the content of base
register with the address part of the instruction.
Effective address = content of base register +
address part of the instruction
Opcode
A
INSTRUCTION
R3
R2
R1(EFF.
ADD)300
R0
BASE REGISTER
301
MEMORY
22. Index Addressing Mode
• The operand’s offset is the sum of the content of
an index register SI or DI.
Opcode
A
301
R3
R2
R1(EFF.
ADD)300
R0
MEMORY
REGISTER
INSTRUCTION
23. 301
Relative Addressing Mode
• In this addressing mode
effective address of the
operand is obtained by
adding the content of
program counter with the
address part of the
instruction.
• Effective address = content
of program counter +
address part of the
instruction
OPCODE A
INSTRUCTION
PC
B
MEMORY
A+B
24. Types of instruction
Data transfer
instruction
Data manipulative instruction
Program
control
instruction