Вы находитесь на странице: 1из 3

Types of Addressing Modes Each instruction of a computer specifies an operation on certain data.

The are various ways of specifying address of the data to be operated on. These different ways of specifying data are called the addressing modes. The most common addressing modes are: 1. Immediate addressing mode 2. Direct addressing mode 3. Indirect addressing mode 4. Register addressing mode 5. Register indirect addressing mode 6. Displacement addressing mode 7. Stack addressing mode To specify the addressing mode of an instruction several methods are used. Most often used are : a) Different operands will use different addressing modes. b) One or more bits in the instruction format can be used as mode field. The value of the mode field determines which addressing mode is to be used. The effective address will be either main memory address of a register. Immediate Addressing: This is the simplest form of addressing. Here, the operand is given in the instruction itself. This mode is used to define a constant or set initial values of variables. The advantage of this mode is that no memory reference other than instruction fetch is required to obtain operand. The disadvantage is that the size of the number is limited to the size of the address field, which most instruction sets is small compared to word length. INSTRUCTION OPERAND Direct Addressing: In direct addressing mode, effective address of the operand is given in the address field of the instruction. It requires one memory reference to read the operand from the given location and provides only a limited address space. Length of the address field is usually less than the word length. Ex : Move P, Ro, Add Q, Ro P and Q are the address of operand.

Indirect Addressing: Indirect addressing mode, the address field of the instruction refers to the address of a word in memory, which in turn contains the full length address of the operand. The advantage of this mode is that for the word length of N, an address space of 2N can be addressed. He disadvantage is that instruction execution requires two memory reference to fetch the operand Multilevel or cascaded indirect addressing can also be used. Register Addressing: Register addressing mode is similar to direct addressing. The only difference is that the address field of the instruction refers to a register rather than a memory location 3 or 4 bits are used as address field to reference 8 to 16 generate purpose registers. The advantages of register addressing are Small address field is needed in the instruction. Register Indirect Addressing: This mode is similar to indirect addressing. The address field of the instruction refers to a register. The register contains the effective address of the operand. This mode uses one memory reference to obtain the operand. The address space is limited to the width of the registers available to store the effective address. Displacement Addressing: In displacement addressing mode there are 3 types of addressing mode. They are : 1) Relative addressing 2) Base register addressing 3) Indexing addressing. This is a combination of direct addressing and register indirect addressing. The value contained in one address field. A is used directly and the other address refers to a register whose contents are added to A to produce the effective address. Stack Addressing: Stack is a linear array of locations referred to as last-in first out queue. The stack is a reserved block of location, appended or deleted only at the top of the stack. Stack pointer is a register which stores the address of top of stack location. This mode of addressing is also known as implicit addressing.

8086 Instruction Set Summary The following is a brief summary of the 8086 instruction set: Data Transfer Instructions MOV Move byte or word to register or memory IN, OUT Input byte or word from port, output word to port LEA Load effective address LDS, LES Load pointer using data segment, extra segment PUSH, POP Push word onto stack, pop word off stack XCHG Exchange byte or word XLAT Translate byte using look-up table Logical Instructions NOT Logical NOT of byte or word (one's complement) AND Logical AND of byte or word OR Logical OR of byte or word XOR Logical exclusive-OR of byte or word TEST Test byte or word (AND without storing) Shift and Rotate Instructions SHL, SHR Logical shift left, right byte or word by 1 or CL SAL, SAR Arithmetic shift left, right byte or word by 1 or CL ROL, ROR Rotate left, right byte or word by 1 or CL RCL, RCR Rotate left, right through carry byte or word by 1 or CL Arithmetic Instructions ADD, SUB Add, subtract byte or word ADC, SBB Add, subtract byte or word and carry (borrow) INC, DEC Increment, decrement byte or word NEG Negate byte or word (two's complement) CMP Compare byte or word (subtract without storing) MUL, DIV Multiply, divide byte or word (unsigned) IMUL, IDIV Integer multiply, divide byte or word (signed) CBW, CWD Convert byte to word, word to double word (useful before multiply/divide) AAA, AAS, AAM, AAD ASCII adjust for addition, subtraction, multiplication, division (ASCII codes 30-39) DAA, DAS Decimal adjust for addition, subtraction (binary coded decimal numbers) Transfer Instructions JMP Unconditional jump JA (JNBE) Jump if above (not below or equal) JAE (JNB) Jump if above or equal (not below) JB (JNAE) Jump if below (not above or equal) JBE (JNA) Jump if below or equal (not above) JE (JZ) Jump if equal (zero) JG (JNLE) Jump if greater (not less or equal) JGE (JNL) Jump if greater or equal (not less)