Anda di halaman 1dari 15

SEMINAR ON

WHAT IS AN INSTRUCTION. WHAT IS AN INSTRUCTION CODE. WHAT IS INSTRUCTION FORMAT. INTRODUCTION TO ADRESSING MODES. TYPES OF ADRESSING MODES.

An Instruction is a command given by user to perform some particular task. An Instruction code is a group of bits used to perform a particular operation on the data stored in a computer.These instruction code and data are stored in memory. An Instruction code is divided in to two parts: Operation code Address of data Operation code defines an operation such as ADD,SUB,MUL,DIV

First part is Operation code defines an operation such as ADD,SUB,MUL,DIV,COMPLEMENT,SHIFT. A n-bit operation code will be able to generate 2^n different operations. Second part is the Address of the memory location or register where the data are to be found. The design of the instruction code may differ from computer to computer.

ADDRESING MODE

OPCODE

OPERAND

HOW THE OPERANDS ARE ACCESSED IN THE INSTRUCTION.

OPERATION THAT I S PERFORM ON THE OPERAND.

DATA ON WHICH THE OPERATION IS TO BE PERFORMED.

There are different methods are used for specifying the operand in memory. The different methods used for specifying the operand in an instruction are called ADDRESSING MODES . The operands (data) of any instruction may stored in memory or register. The way the operands are chosen during program execution is dependent on addressing mode of the instruction. A computer may use one or more addressing mode in its organization. The operands are determined in an instruction during program execution using one of the addressing mode.

Immediate Addressing mode. Implied Addressing mode. Direct or Absolute Addressing mode. Indirect Addressing mode. Register Addressing mode. Register Indirect Addressing mode. Auto increment or Auto decrement Addressing mode. Relative Addressing mode. Index Addressing mode. Base Register Addressing mode.

In this mode the operand is present in the instruction itself i.e. it is a constant data contained in an instruction. The instruction is having operand but no address field. So no fetching of operand is OPCODE IMMIDIATE required from memory. OPERAND Thus if a source operand is part of instruction instead of register or memory it is referred as Immediate Addressing mode. As this mode provides data to its opcode immediately(with no time), this is the another reason this mode is called Immediate Addressing mode.

The Immediate data may be 8 bits(byte) or 16 bits(word) in length. Advantage:Immediate operand can be accessed quickly because they are available directly in instruction queue like a register operand. Hence, there is no need of external bus and bus cycle to obtain the data. Disadvantage:They can only be used as source operands and that they are constant values. E.g. ADD R1 ,#20 [ R1<- R1+10100 ]

This addressing mode is also called inherent addressing mode. This addressing mode is called implied addressing mode because the operand is specified implicitly in the instruction . There is no need of operands or any address of operand field. Operands are present inside the instruction name. E.g. CMA(means complement the contents of accumulator). HLT(means stop processing).

opcode

This addressing mode is very simple. In this mode operands are inside the memory. The address of operand is given by the address field of an instruction format. Only one time memory is accessed to search an operand i.e. why it is termed as direct addressing mode. It is sure that operand is present in memory.

I 0 20

opcod Addr e ess of opera nd(10 0) opera nd

100

E.G

LDA X

AC <- M[X]

This instruction will load the contents of memory location having address X to AC.

ADVANTAGE:No need to calculate the address of operand.

In this mode, address field of instruction specifies memory address where the operands are present. Means ,Instruction specifies memory address and memory address again contains memory address where operand is residing. This addressing mode is helpful to implement the concept of pointers.
E.G. LOAD R1,M[200]

50 100 200 300 500

LOAD

200

500

OPERAND

Also called register direct addressing mode . In this mode , operands are present in one of the register. Address of the register is present in the instruction. Operands are accessed with no time, so this mode is faster than direct addressing mode. This mode is also used to store intermediate results in registers instead of storing in memory. E.G. ADD R1,R2

Register number

opcode

R1

Register R1

operand

Anda mungkin juga menyukai