8085 Instruction Addressing Modes Impp
8085 Instruction Addressing Modes Impp
Group of signals
8085 is a 40 pin IC, DIP package The signals from the pins can be grouped as follows
Power supply and clock signals
Address bus Data bus
CLK (output)-Clock Output is used as the system clock for peripheral and devices interfaced with the microprocessor.
Address bus
A8 - A15 Address bus : These are output, tri-state signals used as higher order 8 bits of 16 bit address. These signals are unidirectional meaning that the address is given by 8085 to select a memory or an I/O device.
Multiplexed address/data bus The advantage of multiplexed bus is microprocessor requires less number of pins. But disadvantage is, we extra IC (Latch) for demultiplexing. Second disadvantage is, due multiplexing, little bit more time required for read/write operations).
Status Signals:
ALE (output) - Address Latch Enable. This signal helps to capture the lower order address presented on the multiplexed address / data bus. IO/M (output) - Select memory or an IO device. This status signal indicates that the read / write operation relates to whether the memory or I/O device. It goes high to indicate an I/O operation. It goes low for memory operations.
Status Signals:
S0,S1 (output) - It is used to know the type of current operation of the microprocessor. These are generally not used in small systems but can be used to generate advanced control signals for large systems.
SOD (output)
This is an active high, serial output port pin, used to transfer serial 1 bit data under software control. When a SIM instruction is executed the SOD pin is set or reset depending on D7 and D6 bits of accumulator.
HOLD signal is generated by the DMA controller circuit. On receipt of this signal, the microprocessor acknowledges the request by sending out HLDA signal and leaves out the control of the buses. After the HLDA signal the DMA controller starts the direct transfer of data.
DMA Controller
READY (input)
This is an active high input control signal. It is used by microprocessor to detect whether a peripheral has completed the data transfer or not. If ready pin is HIGH, the microprocessor will complete the operation and proceed for next operation. But if ready pin is LOW (i.e. peripheral has not yet completed the operation), microprocessor will WAIT until it goes HIGH. The main function of this pin is to synchronize slower peripheral to the faster microprocessor.
TRAP (output) This is an active high level, edge triggered, non maskable, highest priority interrupt. When TRAP line is active microprocessor performs internal restart automatically at address 0024. The net effect of TRAP is, it transfers program control at address 0024.
RST 7.5, RST 6.5,RSR 5.5 Restart interrupts (output) These are active high, edge (RST 7.5) or level (RST 6.5 and RST 5.5) triggered maskable interrupt.
The priorities of these are TRAP and RST 7.5, RST 6.5, RST 5.5. When RST 7.5, RST 6.5, RST 5.5 is active RST 5.5 microprocessor performs internal restart automatically at address 003C, 0034, 002C respectively.
The net effect is, it transfers program control at address, specified above.
INTA Interrupt Acknowledge (input) INTR is an active high, level triggered general purpose and interrupt. When INTR is active, microprocessor generate an interrupt acknowledge signal INTA.
EU & BIU
The 8086 CPU logic has been partitioned into two functional units namely Bus Interface Unit (BIU) and Execution Unit (EU) The major reason for this separation is to increase the processing speed of the processor The BIU has to interact with memory and input and output devices in fetching the instructions and data required by the EU EU is responsible for executing the instructions of the programs and to carry out the required processing
EU & BIU
Architecture Diagram
Execution Unit
The Execution Unit (EU) has
Control unit Instruction decoder
Execution Unit
Control unit is responsible for the co-ordination of all other units of the processor ALU performs various arithmetic and logical operations over the data The instruction decoder translates the instructions fetched from the memory into a series of actions that are carried out by the EU
SP is used as an offset from the current SS during execution of instructions that involve the stack segment in external memory. BP is used in based addressing mode.
Instruction pointer
Segment Registers
The memory of 8086 is divided into 4 segments namely
Code segment (program memory)
Stack memory A stack is a section of the memory set aside to store addresses and data while a subprogram executes
Extra segment This segment is also similar to data memory where additional data may be stored and maintained
Segment Registers
Code Segment (CS) register is a 16-bit register containing address of 64 KB segment with processor instructions The processor uses CS segment for all accesses to instructions referenced by instruction pointer (IP) register Stack Segment (SS) register is a 16-bit register containing address of 64KB segment with program stack By default, the processor assumes that all data referenced by the stack pointer (SP) and base pointer (BP) registers is located in the stack segment
Segment Registers
Data Segment (DS) register is a 16-bit register containing address of 64KB segment with program data By default, the processor assumes that all data referenced by general registers (AX, BX, CX, DX) and index register (SI, DI) is located in the data segment Extra Segment (ES) register is a 16-bit register containing address of 64KB segment, usually with program data By default, the processor assumes that the DI register references the ES segment in string manipulation instructions
Segment Registers
If a location 109F0 of Code Segment is to be addressed to fetch An instruction, the physical address will be calculated as follows CSR = 010A IP = F950 Effective Address = 109F0
Pin 40
Vcc
Pin 19
CLK
Pin 17
INTR
Pin 18
NMI
The signal have dual function as in case of the 8085. They act as bus during the first part of machine cycle and as data bus in the later part.
0
1 1
1
0 1
SS
CS DS
S5 = IF S6 = 0 (ALWAYS)
RD [pin 32]
Read or receive data from M or I/O device TEST [pin 23] Relate to wait instruction. The instruction puts the 8086 in idle state which ends only when the TEST input goes low
.PIN DESCRIPTION
DEN
Data bus Enable. This signal, when low indicates that the microprocessor address/data bus is to be used as data bus.
HOLD
HLDA
Pin 24 -31
INTA - Pin 24 ALE - Pin 25 Address Latch Enable. Since data and address are multiplexed on a single bus. ALE is output high to identify a valid address. DEN -Pin 26 Data Bus Enable. This signal, when low indicates that the microprocessor address/data bus is to be used as data bus.
WR Pin 29
HOLD Pin 30
HLDA - Pin 31
Addressing Modes
Implied Addressing The data value/data address is implicitly associated with the instruction Register Addressing The data is specified by referring the register or the register pair in which the data is present Immediate Addressing The data itself is provided in the instruction Direct Addressing The instruction operand specifies the memory address where data is located
Addressing Modes
Register indirect addressing The instruction specifies a register containing an address, where data is located Based - 8-bit or 16-bit instruction operand is added to the contents of a base register (BX or BP), the resulting value is a pointer to location where data resides Indexed - 8-bit or 16-bit instruction operand is added to the contents of an index register (SI or DI), the resulting value is a pointer to location where data resides
Addressing Modes
Based Indexed - the contents of a base register (BX or BP) is added to the contents of an index register (SI or DI), the resulting value is a pointer to location where data resides Based Indexed with displacement - 8-bit or 16-bit instruction operand is added to the contents of a base register (BX or BP) and index register (SI or DI), the resulting value is a pointer to location where data resides
Arithmetic Instructions
Arithmetic Instructions
Number Representation
Logical Instructions
String Instructions
Assembler Directives
Assembler directives give instruction to the assembler where as other instructions discussed in the above section give instruction to the 8086 microprocessor Assembler directives are specific for a particular assembler
However all the popular assemblers like the Intel 8086 macro assembler, the turbo assembler and the IBM macro assembler use common assembler directives
Important Directives
The ASSUME directive tell the assembler the name of the logical segment it should use for a specified segment The DB directive is used to declare a byte-type variable or to set aside one or more storage locations of type byte in memory (Define Byte) The DD directive is used to declare a variable of type doubleword or to reserve memory locations which can be accessed as type doubleword (Define Doubleword) The DQ directive is used to tell the assembler to declare a variable 4 words in length or to reverse 4 words of storage in memory (Define Quadword)
Important Directives
The ENDS directive is used with the name of a segment to indicate the end of that logical segment
Data or code
Labels Mmnemonics Operands Comments
A comments column gives space to describe the function of the instruction for future reference