Microprocessor Technology-1
Microprocessor Technology-1
Microprocessor Technology-1
COT 05212
Sub-enabling
Describe the concepts of microprocessor and micro-controller.
Explain micro-processor architecture families (8085).
Explain micro-controller architecture families (8086).
Describe various memories of microprocessor system.
Describe the architecture of microprocessor families 8085
Describe the architecture of microprocessor families 8086
Explain various registers and pointers of microprocessor systems
Explain various types of interrupts
MICROPROCESSOR/MICRO-CONTROLLER
Microprocessors:
– is a multipurpose, programmable ,clock driven, register based electronic
device, that read binary instructions from storage device called
“memory”.
– Microprocessor: Accept the binary data as input and process data
according to those instructions and provides results as an output.
• A typical programmable machine/device can represented with three
components:
Microprocessor
Memory
I/O
These three component work /interact with each other to perform a
given task.
Microcontroller:
– is a small computer on a single metal-oxide-semiconductor (MOS)
integrated circuit (IC) chip.
– A microcontroller contains one or more CPUs (processor cores) along
with memory and programmable input/output peripherals.
MICROPROCESSOR/MICRO-CONTROLLER
Binary Digits
– Microprocessor operates in binary digits(bits) –(0,1)
– These digits are represented in terms of electrical voltage in machine.
– “0” represent low voltage level and “1” represent high voltage level.
– Each microprocessor recognizes and process a group of bits called “word”
– So, each microprocessor can be classified according to their “word length”
– Then, it means a microprocessor with an 8-bit word(length) is know as 8-bit
microprocessor.
*16-bit word?
*32-bit word?
Microprocessor as programmable device.
– Its programmable, means it can be instructed to perform a given tasks within
its capability.
– Its design to understand and execute many binary instructions, defined by its
instruction set.
MICROPROCESSOR/MICRO-CONTROLLER
• Memory
– Memory is like pages of notebooks with space of a fixed number of binary
numbers on each line.
– Memory are made of semiconductors material.
– Each line is an 8-bit register.
– Several arrangement of these register in a sequence is called “memory”
– These registers are always grouped together in power of two(2)
– An 8-bit register on a semiconductor chip is known as “1k bytes of
memory”_>>>>1024 bytes
• I/O
– User can enter instruction and data into memory through devices such as
keyboard or simple switches.[Input devices]
{then microprocessor can read the instructions from the memory and process
the data according to those instruction}
– The result can be displayed by a device such as seven segments LEDs or
printed by a printer
Assignment
NOTE:
Assembler is a program that translates the mnemonics entered by the ASCII keyboard into the corresponding binary
machine codes of the microprocessor, each microprocessor has its own assembler due to the fact machine code ins not
transferable.
Differences between 8085 and 8086 Microprocessor
8085 Microprocessor 8086 Microprocessor
It is an 8-bit microprocessor. It is a 16-bit microprocessor.
It has an 8-bit wide data bus. It has 16-bit wide data bus.
It can address 28 = 256 I/O ports. It can address 216 = 65,536 I/O ports.
It has 16-bit wide address bus. It has 20-bit wide address bus.
It has an 8-bit ALU (Arithmetic Logic Unit). It has a 16-bit ALU.
It can process an 8-bit of data in one It can process 16-bit of data in one
machine cycle. machine cycle
The maximum accessible memory (RAM) The maximum accessible memory of 8086
it can access is 216 = 64KB is 220 = 1MB.
It has an on-chip oscillator of 3 MHz It is available in 3 versions with a clock
frequency of 5 MHz, 8 MHz and 10 MHz.
MICROPROCESSOR/MICRO-CONTROLLER
APPLICATION
Microprocessor application are classified primarily in two categories;
• Reprogrammable
• Embedded system
• In reprogrammable systems such as microcomputer ,microprocessor is used for
computing and data processing.
– These system include general purpose microprocessor capable of handling
large data ,mass storage devices(disks,cd-rom) and peripherals such as
printers.
– Personal computer is a typical illustration of reprogrammable systems.
• In embedded systems, the microprocessor is a part of a final product and it is not
available for reprogramming to the end user.
– Copy machine is a typical illustration of embedded system .
– Embedded system s can also be viewed as a products that uses
microprocessor to perform their operations(microprocessor based products)
MICROPROCESSOR/MICRO-CONTROLLER
APPLICATION
• Examples of Embedded system include a wide range of product such as:
» Washing machine
» Dish washers
» Automatic testing instruments
» Automatic dashboard control
» Traffic lights controllers
8085 MICROPROCESSOR ARCHITECTURE
Internal Architecture
8085 MICROPROCESSOR ARCHITECTURE..
• The 8085 microprocessor is an 8-bit processor available as a 40-pin IC package and
uses +5 V for power.
• It can run at a maximum frequency of 3 MHz
• Its data bus width is 8-bit and address bus width is 16-bit, thus it can address 2
power(16) = 64 KB of memory.
8085 MICROPROCESSOR ARCHITECTURE..
Registers:
• Registers in 8085 microprocessor can be classified into two category:
1. Special Purpose Registers
• These registers are used to store or copy temporary data, by using instructions,
during the execution of the program.
• Example of these registers are:
Accumulator.
Flag registers.
Memory Registers like; PC and SP
2. General Purpose Registers
• The 8085 has six general-purpose registers to store 8-bit data; these are identified
as- B, C, D, E, H, and L.
• These can be combined as register pairs – BC, DE, and HL, to perform some 16-bit
operation.
• These registers are used to store or copy temporary data, by using instructions,
during the execution of the program.
8085 MICROPROCESSOR ARCHITECTURE..
Accumulator
• The accumulator is an 8-bit register that is a part of ALU.
• This register is used to store 8-bit data and to perform arithmetic and logical operations.
• The result of an operation is stored in the accumulator.
• The accumulator is also identified as register A.
Flag register
• The ALU includes five flip-flops, which are set or reset after an operation according to data condition
of the result in the accumulator and other registers.
• They are called Zero (Z), Carry (CY), Sign (S), Parity (P) and Auxiliary Carry (AC) flags.
• Their bit positions in the flag register are shown in Fig below.
{for example; to read an instruction from a memory location-the MPU places the 16-bit
address on the address bus, the address on the bus is decoded by an external logic circuits
and the memory location is identified. The MPU sends a pulse called Memory read as the
control signals. The pulse activates the memory chip, and the contents of the memory
location(8 bit data) are placed on the data bus and brought insides the microprocessor.}
Read memory Operation
Instruction
Memory decode
and
data
MPU Memory chip
T1
• The high-order memory address 20H is placed
on the address lines.
• The low order memory address 05H is placed
on the bus AD7-AD0 and the ALE goes high.
• Similarly, the status signal IO/m goes low,
indicating that this is memory related
operation.
T2
• Control unit send the RD to enable the
memory chip during two clock periods.
• When the chip is enabled; the instruction
byte(4FH0 is placed on the bus AD7-AD0 and
when RD goes high, it cause the bus to go high
impedance.
T4
• Machine code is decoded by the instruction
decoder and the contents of the accumulator
are copied into register C.
INTERRUPTS IN 8085 MICROPROCESSOR
• When microprocessor receives any interrupt signal from peripheral(s) which are requesting
its services, it stops its current execution and program control is transferred to a sub-routine
by generating CALL signal and after executing sub-routine by generating RET signal again
program control is transferred to main program from where it had stopped.
• When microprocessor receives interrupt signals, it sends an acknowledgement (INTA) to the
peripheral which is requesting for its service.
• Interrupts can be classified into various categories based on different parameters:
I. Hardware and Software Interrupts
II. Vectored and Non-Vectored Interrupts
III. Maskable and Non-Maskable Interrupts
INTERRUPTS IN 8085 MICROPROCESSOR
Hardware Interrupts
When microprocessors receive interrupt signals through pins (hardware) of
microprocessor, they are known as Hardware Interrupts.
There are 5 Hardware Interrupts in 8085 microprocessor.
They are – INTR, RST 7.5, RST 6.5, RST 5.5, TRAP
Software Interrupts
Software Interrupts are those which are inserted in between the program which
means these are mnemonics of microprocessor.
There are 8 software interrupts in 8085 microprocessor.
They are – RST 0, RST 1, RST 2, RST 3, RST 4, RST 5, RST 6, RST 7.
INTERRUPTS IN 8085 MICROPROCESSOR
Vectored and Non-Vectored Interrupts
Vectored Interrupts are those which have fixed vector address (starting address of
sub-routine) and after executing these, program control is transferred to that
address.
Vector Addresses are calculated by the formula 8 * TYPE.
INTERRUPT VECTOR ADDRESS
RST 5.5 2C H
RST 6.5 34 H
RST 7.5 3C H
INTERRUPTS IN 8085 MICROPROCESSOR
Vectored Interrupts
Vectored Interrupts are those which have fixed vector address (starting address of
sub-routine) and after executing these, program control is transferred to that
address.
Vector Addresses are calculated by the formula 8 * TYPE.
RST 5.5 2C H
RST 6.5 34 H
RST 7.5 3C H
INTERRUPTS IN 8085 MICROPROCESSOR
Vectored Interrupts ……
For Software interrupts vector addresses are given by:
INTERRUPT VECTOR ADDRESS
RST 0 00 H
RST 1 08 H
RST 2 10 H
RST 3 18 H
RST 4 20 H
RST 5 28 H
RST 6 30 H
RST 7 38 H
INTERRUPTS IN 8085 MICROPROCESSOR
Non-Vectored Interrupts
• Non-Vectored Interrupts are those in which vector address is not predefined.
• The interrupting device gives the address of sub-routine for these interrupts.
• INTR is the only non-vectored interrupt in 8085 microprocessor.
INTERRUPTS IN 8085 MICROPROCESSOR
Maskable Interrupts
• Maskable Interrupts are those which can be disabled or ignored by the
microprocessor.
• These interrupts are either edge-triggered or level-triggered, so they can be
disabled. INTR, RST 7.5, RST 6.5, RST 5.5 are maskable interrupts in 8085
microprocessor.
Non-Maskable Interrupts
• Non-Maskable Interrupts are those which cannot be disabled or ignored by
microprocessor.
• TRAP is a non-maskable interrupt.
• It consists of both level as well as edge triggering and is used in critical power
failure conditions.
INTERRUPTS IN 8085 MICROPROCESSOR
Priority of Interrupts
• When microprocessor receives multiple interrupt requests simultaneously, it will
execute the interrupt service request (ISR) according to the priority of the
interrupts
INTERRUPTS IN 8085 MICROPROCESSOR
Instruction for Interrupts
1. Enable Interrupt (EI)
The interrupt enable flip-flop is set and all interrupts are enabled following the
execution of next instruction followed by EI. No flags are affected. After a system reset,
the interrupt enable flip-flop is reset, thus disabling the interrupts. This instruction is
necessary to enable the interrupts again (except TRAP).
2. Disable Interrupt (DI)
This instruction is used to reset the value of enable flip-flop hence disabling all the
interrupts. No flags are affected by this instruction.
3. Set Interrupt Mask (SIM)
It is used to implement the hardware interrupts (RST 7.5, RST 6.5, RST 5.5) by setting
various bits to form masks or generate output data via the Serial Output Data (SOD)
line. First the required value is loaded in accumulator then SIM will take the bit pattern
from it.
4. Read Interrupt Mask (RIM)
This instruction is used to read the status of the hardware interrupts (RST 7.5, RST 6.5,
RST 5.5) by loading into the A register a byte which defines the condition of the mask
bits for the interrupts. It also reads the condition of SID (Serial Input Data) bit on the
microprocessor.
MEMORIES OF MICROPROCESSOR SYSTEM
Flip Flop/Latch
• Generally, memory is circuit that can store bits.
• Flip flop or latch is a basic element of memory for storing information.
• One latch or flip-flop can store one bit of information.
• The main difference between latches and flip-flops is that for latches, their outputs
are constantly affected by their inputs as long as the enable signal is asserted. In other
words, when they are enabled, their content changes immediately when their inputs
change.
• Flip-flops, on the other hand, have their content change only either at the rising or
falling edge of the enable signal.
• This enable signal is usually the controlling clock signal.
• After the rising or falling edge of the clock, the flip-flop content remains constant
even if the input changes.
• There are basically four main types of latches and flip-flops: SR, D, JK, and T.
• The major differences in these flip-flop types are the number of inputs they have and
how they change state.
• The simplest sequential circuit or storage element is a bistable element, which is
constructed with two inverters connected sequentially in a loop.
• To avoid unintentional change in the input and control the availability of the out, we
use tri-state (active low level) buffers on the latch.
Latch/flip flop
• Latch which can store one binary is called a memory cell.
Din D
Q Dout
Enable EN
• Tri-state buffer
• An interested part is how we deal with more than one chip; for example, two chips
with four registers each.
• We can have a total of eight registers; three address lines, but one line should be
used to select between the two chips(Chip select signal )
• A2(with inverter) and Chip select is used to select between these two chips.
• When A2 is low (0),chip M1 is selected and when M2 is high(1),chip M2 is selected.
• The address on A0 and A1 will determine the registers to be selected: thus by
combining the logic on,A0,A1,A2 the memory address range from 000 to 111.
• The concepts of the chip select signal gives us a more flexibility in designing chips
and allows us to expand memory size by using multiple chips.
REGISTER WITH DIFFERENT MEMORY CELL IN DIFFERENT CHIP….
REGISTER WITH DIFFERENT MEMORY CELL IN DIFFERENT CHIP….
• Now let us examine the problem from a different perspective, assume we have
available four address lines and memory chips with four registers.
• Four address lines are capable of identifying 16 registers; however we need only
three address lines to identify eight registers. What should we do with the fourth
line?
• Memory chip M1 is selected when A3 and A2 are both 0,therefore register in these
chip are identified with the address ranging from 0000 to 0011(0-3).
• Memory of chip M2 will range from 1000 to 1011 (8 to B);this chip is selected only
when A3 is 0 and A2 is 0.
Memory Mapping and Addresses
• Memory mapping is a pictorial representation in which memory devices are
located in the entire range of addresses.
• Memory addresses; provide the locations of various memory devices in the system
and interfacing logic defines the range of memory for each memory device.
• 16 address line are available for memory.
• This means it is a numbering system of 6 binary bits and is capable of identifying
65,536 memory registers, each register with a 16-bit address.
• The entire memory address can range from 0000-FFFF in Hexadecimal.
• Let assume that we have a memory chip with 256 registers, we need only 256
number out of 65,536 that require eight address line(8-bit).
• We can use other remaining 8 address lines to assign fixed logic to generate a
fixed number using for chip select through appropriate logic gate.
Memory Mapping and Addresses….
• Previously, we define 1024 as 1k,therefore a 1K-byte memory chip has 1024
register with 8 bit each.
• A group of 256 register is defined as one page and each register is viewed as line to
write on.
• So we can view 1k-byte memory as a chip with four pages(1024/256=4) with each
page have 256 registers each with 8 bit.
• In two hex digit,256 registers can numbered from 00H-FFH,and for 1024 register
can numbered from 00H-03FFH.
• If we examine the high-order digits, we can find that they range from 00-03
representing five pages(00,01,02,03).
• Memory map is used generally for the entire address range of a memory chips in a
given system.
Memory Mapping and Addresses….
• Illustrating the memory address range of the chip with 256 registers each with
eight bit//(256*8)memory.
Memory Mapping and Addresses….
• Illustrating the memory address range of the chip with 256 registers each with
eight bit//(256*8)memory………..
– It has eight address line from A0-A7 of the microprocessor which
required to identify 256 memory registers.
– The address line A0-A7 can assume any combination from 00H-FFH and
identify any of 256 register through the decoder.
– The remaining lines A8-A15 are connected to the chip select/chip enable
line through inverters and the NAND gate.
– The memory chip is selected or enable when chip select goes low,
therefore to select the chip the address line A8-A15 should be at logic
0,which will cause the output of NAND to go low.
– Since we have 16 address lines, the address range of the selected chip
will range from 0000H-00FFH.
– The address lines A15-A8 which are used to select the chip, must have
fixed levels, these lines are called High order address lines.
– The address lines A7-A0,they can be assigned logic levels from all 0s to
1s and any in between combination.
Memory Mapping and Addresses….
• Illustrating the memory address range of the chip with 256 registers each with
eight bit//(256*8)memory………..
– For example when low order address lines are all
0s;the register 0 is selected, and when they are all
1s,the register 255(FFH) is selected.
Memory Mapping and Addresses….
• Illustrating; memory address range can be assigned in various locations over the entire address of memory
map(0000H-FFFFH).
– It means address range of a given chip can be changed by
modifying the hardware of Chip select/chip enable.
– The chip select addresses are determined by the
hardware(inverters and NAND gate).
– For example; if the inverter on line A15 is moved, the address
required on A15-A8 to enable the chip will be as follows:
………………………..?????
– The memory address range will be ………?????
Note
– Both chip have 256*8 register.
– By modify the Chip select hardware, the location
of chip in the map is change, hence the chip addr.
Memory Mapping and Addresses….
• As we previously see, if the chip include 256 register; the high order address lines
(A15-A8)and low order address lines(A7-A0) were equally divided.
• So what if the chip include more than 256 register!!!! 512,1k-btye,2k-
byte……….;what might be their high order address lines and low order address
lines.
• To know the details of these machine cycles we will focus on three operation
performed by microprocessor;-
1. Opcode fetch machine cycle
2. Memory write machine cycle
3. Memory read machine cycle
Opcode fetch machine cycle
• The first operation in any instruction is an opcode fetch.
• Microprocessor needs to get/fetch these machine code from the memory register
before microprocessor can begin to execute the instruction.
• To differentiate an opcode from data byte or an address,this opcode fetch machine
cycle is identified by status signals-(011)
• Opcode fetch machine cycle has 4-clock periods.(4T-states).
• T1-T3 to fetch the opcode and T4-for instruction decoder to decode the byte.
• Opcode fetch machine cycle is also called M1.
Memory read machine cycle
• May be referred as M2.
• It has 3T-states.
• As we discuss, the first byte of any instruction is for opcode fetch, so will examine
memory read machine cycle by examine the execution of 2-byte instruction,3-byte
instruction and so on.
Machine cycle and Bus timing
• Example.
1. Two machine codes(3EH) and 32H-are stored in memory locations 2000H and
2001H respectively.
-The first machine code (3EH) represents the opcode to load a data byte in the
accumulator.//see mnemonic code.
Memory location Machine code
Instruction
2000H 3EH
MVI A,32H;load byte/constant into accumulator
2001H 32H
This instruction consists of two bytes; first is the opcode and the second is the
data byte.
8085 needs to read these bytes first from memory and thus requires at least two
machine cycles(opcode fetch and second memory read machine cycle).
This kind of instruction requires seven T-states for these two machine cycles.
Machine cycle and Bus timing
8085 TIMING FOR THE EXECUTION OF THE INSTRUCTION; MVI A,32H
The first machine cycle cycle(opcode fetch) is identical in bus timing with status
signal-011
After completion of the M1,the 8085 place the address 2001H on the address
bus and increment PC by 1,to memory location 2002H.
– The M2 is identified by status signal-010
– ALE goes low after clock period one(T1) of M1 and M2 (WHY??)
– T2 of both cycle,read signal(active low) become active and enable the
chip/memory.
At rising edge of T2,8085 activate the data bus as an input bus, memory place
the data byte 32H on the data bus, and reads and stores byte in the
accumulator during T3.
Machine cycle and Bus timing
8085 TIMING FOR THE EXECUTION OF THE INSTRUCTION; MVI A,32H
M1
T1:
• microprocessor identifies that is an M1 by
placing 011 status signal.
• It place 2000H memory address from PC on
address bus.20H ,high order memory address
on lines(A15-A8) and 00H into multiplexed
bus-low order memory address lines(A7-A0)-
refer latch, and the PC increment the memory
address by 1.
T2:
• Read signal(active low) is enabled to enable
the chip, and memory place the 32H data byte
on the data bus from memory location 2000H.
• 8085 places the opcode on instruction
decoder/register and disable the read signal
at rising edge of T3.
• So the fetch is completed at T3.
T4:decode the opcode to see its command
Machine cycle and Bus timing
8085 TIMING FOR THE EXECUTION OF THE INSTRUCTION; MVI A,32H
M2
T1:
• Place what in data bus?? ,which address is for
high/low order memory lines?
• Status signal for this cycles? why?
• Status of PC after operation?
T2:
• RD(active low) become active and enable the chip.
• At rising edge of T2,the 8085 activates the data bus
an input bus, memory place the data byte 32H on
the data bus
T3:
• 8085 reads and stores the bytes in the accumulator.
Execution time for machine Cycles
• Given
Clock frequency (f)=2MHZ note; //diff processor have different clock speed
T-states/clock period=1/f T-state=??
MVI A, 32H
//5687H (try this)
Addition
– Any 8-bit number, or the contents of a register or the contents of a memory location can be added to the
contents of the accumulator and the sum is stored in the accumulator.
– No two other 8-bit registers can be added directly (e.g., the contents of register B cannot be added directly
to the contents of the register C).
– The instruction DAD is an exception; it adds 16-bit data directly in register pairs.
Subtraction
– Any 8-bit number, or the contents of a register, or the contents of a memory location can be subtracted from
the contents of the accumulator and the results stored in the accumulator.
– The subtraction is performed in 2's compliment, and the results if negative, are expressed in 2's complement.
– No two other registers can be subtracted directly.
Increment/Decrement
– The 8-bit contents of a register or a memory location can be incremented or decrement by 1. Similarly, the
16-bit contents of a register pair (such as BC) can be incremented or decrement by 1.
– These increment and decrement operations differ from addition and subtraction in an important way; i.e.,
they can be performed in any one of the registers or in a memory location.
INSTRUCTION SET CLASSIFICATION
LOGICAL OPERATIONS
These instructions perform various logical operations with the
contents of the accumulator.
AND, OR Exclusive-OR
– Any 8-bit number, or the contents of a register, or of a memory location can be
logically ANDed, Ored, or Exclusive-ORed with the contents of the
accumulator.
– The results are stored in the accumulator.
Rotate
Each bit in the accumulator can be shifted either left or right to the next position.
Compare
Any 8-bit number, or the contents of a register, or a memory location can be
compared for equality, greater than, or less than, with the contents of the
accumulator.
Complement
– The contents of the accumulator can be complemented.
– All 0s are replaced by 1s and all 1s are replaced by 0s.
INSTRUCTION SET CLASSIFICATION
BRANCHING OPERATIONS.
This group of instructions alters the sequence of program execution either
conditionally or unconditionally.
Jump
• Conditional jumps are an important aspect of the decision-making
process in the programming.
• These instructions test for a certain conditions (e.g., Zero or Carry flag)
and alter the program sequence when the condition is met.
• In addition, the instruction set includes an instruction called
unconditional jump.
Call, Return, and Restart
• These instructions change the sequence of a program either by calling a
subroutine or returning from a subroutine. The conditional Call and
Return instructions also can test condition flags.
INSTRUCTION SET CLASSIFICATION
MACHINE-CONTROL OPERATIONS.
These instructions control machine functions such as Halt, Interrupt, or
do nothing.
Some of Instruction and their descriptions
Data Transfer Instructions
Opcode Operand Description
MOV Rd, Rs Copy from source to destination.
M, Rs
Rd, M
This instruction copies the contents of the source register into the destination
register.
If one of the operands is a memory location, its location is specified by the contents
of the HL registers.
This instruction copies the contents of that memory location into the accumulator.
The contents of either the register pair or the memory location are not altered.
Example: LDAX B
Data Transfer Instructions
Opcode Operand Description
LXI Reg. pair, 16-bit Load register pair immediate
data
This instruction copies the contents of memory location pointed out by 16-bit
address into register L.
The contents of accumulator are copied into the memory location specified by
the contents of the register pair.
Example: STAX B
Data Transfer Instructions
Opcode Operand Description
SHLD 16-bit address Store H-L registers direct
The contents of register L are stored into memory location specified by the 16-
bit address.
The contents of register H are stored into the next memory location.
Example: XCHG
Data Transfer Instructions
Opcode Operand Description
SPHL None Copy H-L pair to the Stack Pointer (SP)
Example: SPHL
Data Transfer Instructions
Opcode Operand Description
XTHL None Exchange H–L with top of stack
The contents of L register are exchanged with the location pointed out by the
contents of the SP.
The contents of H register are exchanged with the next location (SP + 1).
Example: XTHL
Data Transfer Instructions
Opcode Operand Description
PCHL None Load program counter with H-L contents
The contents of registers H and L are copied into the program counter (PC).
The contents of H are placed as the high-order byte and the contents of L as the
low-order byte.
Example: PCHL
Data Transfer Instructions
Opcode Operand Description
PUSH Reg. pair Push register pair onto stack
SP is again decremented and the contents of low-order registers (C, E, L, Flags) are
copied into stack.
Example: PUSH B
Data Transfer Instructions
Opcode Operand Description
POP Reg. pair Pop stack to register pair
The contents of location pointed out by SP are copied to the low-order register (C,
E, L, Flags).
SP is incremented and the contents of location are copied to the high-order register
(B, D, H, A).
Example: POP H
Data Transfer Instructions
Opcode Operand Description
OUT 8-bit port address Copy data from accumulator to a port with 8-bit
address
Example: OUT 78 H
Data Transfer Instructions
Opcode Operand Description
IN 8-bit port address Copy data to accumulator from a port with 8-bit
address
Example: IN 8C H
Arithmetic Instructions
• These instructions perform the operations like:
– Addition
– Subtract
– Increment
– Decrement
Addition
• Any 8-bit number, or the contents of register, or the contents of memory location
can be added to the contents of accumulator.
The contents of register or memory and Carry Flag (CY) are added to the contents
of accumulator.
Example: ADI 45 H
Arithmetic Instructions
Opcode Operand Description
The 8-bit data and the Carry Flag (CY) are added to the contents of accumulator.
Example: ACI 45 H
Arithmetic Instructions
Opcode Operand Description
The 16-bit contents of the register pair are added to the contents of H-L pair.
Example: DAD B
Arithmetic Instructions
Opcode Operand Description
SUB R Subtract register or memory from accumulator
M
The contents of the register or memory location are subtracted from the contents
of the accumulator.
The contents of the register or memory location and Borrow Flag (i.e. CY) are
subtracted from the contents of the accumulator.
Example: SUI 45 H
Arithmetic Instructions
The 8-bit data and the Borrow Flag (i.e. CY) is subtracted
from the contents of the accumulator.
The result is stored in accumulator.
Example: SBI 45 H
Arithmetic Instructions
Example: INX H
Arithmetic Instructions
Example: DCX H
Logical Instructions
– OR operation
– XOR operation
– Greater Than
– Less Than
if (A) > (reg/mem): carry and zero flags are reset.
if (A) > data: carry and zero flags are reset
The contents of the accumulator are logically ANDed with the contents
of register or memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is specified by the
contents of H-L pair.
S, Z, P are modified to reflect the result of the operation.
CY is reset and AC is set.
Example: ANA B or ANA M.
Logical Instructions
The contents of the accumulator are XORed with the contents of the register or
memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is specified by the contents of H-L
pair.
S, Z, P are modified to reflect the result of the operation.
The contents of the accumulator are logically ORed with the contents of the register
or memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is specified by the contents of H-L
pair.
S, Z, P are modified to reflect the result.
RST 1 0008 H
RST 2 0010 H
RST 3 0018 H
RST 4 0020 H
RST 5 0028 H
RST 6 0030 H
RST 7 0038 H
Control Instructions
• These are the instructions used to transfer the data from one
register to another register, from the memory to the register,
and from the register to the memory without any alteration in
the content.
• Addressing modes in 8085 is classified into 5 groups:
Immediate addressing mode
Register addressing mode
Direct addressing mode
Indirect addressing mode
Implied addressing mode
ADDRESSING MODE…
• Immediate addressing mode
• Register addressing mode
• Direct addressing mode
• Indirect addressing mode
• Implied addressing mode