Computer Architecture Study Guide 3
displacement
it is an 8 bit or 16 bit immediate value given in the instruction
The 8086 memory addressing modes provide flexible access to (8086 microprocessor)
memory... allows you to asily access variables, arrays, records, pointers, etc
In direct addressing/absolute addressing mode what is required to access the data
one memory reference operation
What is required to access data in an auto indexed incrememnt mode
one register reference one memory reference one ALU oepration
What do you need in an auto indexed decrement mode to access data
one register reference, one memory reference and one alu operation is required to access the data
An assembly language program instruction consists of two parts:
opcode operand
Adressing modes are the operation field specifies the
opertaions which needs to be performed
PC relative and base register both addressing modes are suitable for
program relocation at runtime
They key to good assembly language programming is the
pruper use of memory addressing modes
Auto decrement mode is same as auto increment mode. Both can also be used to implement a stack as
push and pop (good for last in first out data structure)
Based on the availability of effective address, indirect mode is of two kind which is:
register indirect memory indirect
Three types of CPU organization:
single accumulator organization general register organization stack organization
With addressing modes, the operation must be executed on
some data which is already stored in computer registers or in the memory
The memory address of an operand consists of two components:
starting address of memory segment effective address/offset
Register mode
the operand is placed in one 8 bit or 16 bit general purpose registers. The data is in the register that is specified by the instruction
Direct addressing/absolute addressing mode
the operands offset is given in the instruction as an 8 bit or 16 bit displacement element. in this addressing mode the 16 bit effective address of the data is part of the instruction
Register indirect mode
the operands offset is placed in any one of the registers 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
Auto decrememnt mode is same as auto increment mode true or false
true
How many references are required for indirect addressing mode
two
Base register addressing mode
used to implement inter segment transfer of control (effective address is obtained by adding base register value to address field value)
PC relative addressing mode
used to implement intra segment transfer of control.
Addressing modes refers to the
way in which the operand of an instruction is specified. Specifies a rule for interpreting/modifying the address field of the instruction before the operand is actually executed
based register addressing mode is best suitable to
write position independent codes
Auto indexed decrement mode
effective address of the operand is the contents of a register specified in the instruction. before accessing the operand, the contents of the register are automatically decremented to point to the previous consecutive memory location - R1
Different addressing modes used by 8086 microprocessor
implied mode immediate addressing mode register mode register indirect mode auto indexed (increment mode) auto indexed(decrement mode direct addressing/absolute addressing mode indirect addressing mode indexed addressing mode based indexed addressing
implied mode
in implied addressing, the operand is specified in the instruction itself. the data is 8 bits or 16 bits long and data is part of the instruction.
indirect addressing mode
in this mode address field of instruction contains the address of effective address.
immediate addressing mode (symbol #)
in this mode data is present in address field of instruction. Designed like one address instruction format
memory indirect
in this mode effective address is in the memory and corresponding memory address will be maintained in the address field of an instruction (two mem reference required to access the data)
register indirect
in this mode effective address is in the register and corresponding register name will be maintained in the address field of an instruction (one refernece, one memory ref is required to access the data)
Addressing modes is used for one or both of the purposes. These can also be said as the advantages of using addressing mode:
1.To give programming versatility to the user by providing facilities as pointers to memory, counter for loop control, indexing of data, etc 2.To reduce the number of bts in the addressing field of the instruction
What are the referneces required for indirect addressing mode
1st reference to get effective address 2nd reference to access the data
Addressing mode very much depends on the type of ___ organization
CPU
Auto indexed (increment mode)
Effective address of the operand is the contents of a register specified in the instruction. After accessing the operand, the contents of this register are automatically incrememnted to point to the next consecutive memory location
An offset is determined by
adding any combination of three address elements: displacement, base and index
The way of choosing operands during program execution is dependent on
addressing modes of instruction
In pc relative addressing mode, how is the effective address obtained
by adding displacement to PC
index
content of index register SI or DI
base
contents of base register, BX or BP