ARITHMETIC , LOGICAL AND
DATA TRANSFER INSTRUCTIONS
IN 8085 MICROPROCESSOR
P resen t b y :
226450307006. Ba ri y a P ri y a J .
226450307071. Ma ch h i V a n sh i ka R.
226450307074. Ma l a p D ev a n sh i J .
CONTENTS
O verview of Data transfer Arithmetic Logic al
instruc tion set instruc tions instruc tions instruc tions
01
Overview of
Instruction Set
Instructions Set
• The entire group of instruction that a microprocessor
supports Is called Instuction Set.
• 8085 has 256 [Link] instruction is
represented by 8-Bit binary value.
• This 8-bit binary value is called opcode or instruction
Byte.
Cl as s i fi c ati on Of I n s tru c ti on Set
1. Data Transfer Instruction
2. Arithmetic Instruction
3. Logical Instruction
02
Data Transfer
instruction
• The data transfer means copying the data from one place to another place.
• The data transfer instruction is used to copy the content from source to
destination and it does not destroy the content from source.
• Data can be moved between register to register, register to memory and memory
to register and specific value to register/memory.
• The data transfer can also access the memory location directly or indirectly to load
data or store data.
NOTE : Flags are not modified in any of data transfer
instructions.
Types of Data Transfer Instructions in 8085
1. Register to Register 3. Register to Memory
• MOV Rd, Rs: Moves the contents of • MOV M, Rs: Moves the contents of
register Rs to register Rd. register Rs to the memory location
• Example: MOV B, C addressed by the HL register pair.
2 . Memory to Register • Example: MOV M, A
• MOV R, M: Moves the contents of the 4. Immediate Data Transfer
memory location addressed by the HL • MVI Rd, data : Moves immediate 8-bit
register pair to register Rd. data to register Rd.
• Example: MOV A, M • Example: MVI A, 55H
Types of Data Transfer Instructions in 8085
5. Memory to Accumulator 7. Load H and L Directly
• Loads the contents of the specified LHLD addr : Loads the contents of the
memory address into the accumulator. specified memory location and the next
• Example: LDA 2000H2 . Memory to location into registers L and H,
Register respectively.
6. Accumulator to Memory Example: LHLD 4000H
• STA addr : Stores the contents of the
accumulator into the specified memory
address.
• Example: STA 3000H
Types of Data Transfer Instructions in 8085
8. Store H and L Directly 9. Load Accumulator Indirectly
• SHLD addr : Stores the contents of LDAX Rp : Loads the contents of the
registers L and H into the specified memory location pointed to by register
memory location and the next location. pair Rp (either BC or DE) into the
• Example: SHLD 5000H 2 . accumulator.
Example: LDAX B
10. Store Accumulator Indirectly
• STAX Rp : Stores the contents of the
accumulator into the memory location
pointed to by register pair Rp.
• Example: STAX D
Types of Data Transfer Instructions in 8085
11. Exchange Registers 12. Move Immediate to Memory
• XCHG: Exchanges the contents of the HL • MVI M, data: Moves immediate data to
register pair with the DE register pair. the memory location addressed by the
• Example: XCHG HL register pair.
• Example: MVI M, 08H
03
Arithmetic
instruction
• The arithme tic instruc tions are used to perform
arithme tic operati on like additio n, subtrac tion,etc ...
• The 8085 provide s 8-bit /16-bit additio n and 8-bit
subtrac tion instruc tions.
• The increm ent and decrem ent instruc tions are used to
increm ent and decrem ent the conten t of registe r or
registe r pair by 1, and result will be stored into same
registe r or registe r pair given in instruc tion.
NOTE : all flags are modified after execution of arithmetic
instruction as per the result.
Types of Aritmetic Instructions in 8085
1. ADD R/M 2. ADC R/M
• Add register or memory to accumulator • Add register or memory to accumulator
• The contents of a register or memory with carry
location are added to the accumulator, • Adds the contents of a register or
and the result is stored in the memory along with the Carry flag to the
accumulator. All flags (Sign, Zero, Parity, accumulator. The result is stored in the
Carry, Auxiliary Carry) are affected based accumulator, and all flags are affected.
on the result. • Example: ADC B (Adds the contents of
• Example: ADD B (Adds the contents of register B and the carry to the
register B to the accumulator). accumulator)
Types of Aritmetic Instructions in 8085
3. ADI 8-bit data 4. ACI 8-bit data
• Add immediate 8-bit data to • Add immediate 8-bit data with carry to
accumulator accumulator Similar to ADI, but includes
• The 8-bit immediate data is added to the the Carry flag in the addition.
accumulator, and the result is stored in • Example: ACI 45H
the accumulator. All flags are affected. 5. DAD Reg. pair
• Example: ADI 45H (Adds immediate • Add register pair to HL register pair
value 45H to the accumulator) Adds the 16-bit contents of the specified
register pair to the HL register pair.
• Example: DAD H
Types of Aritmetic Instructions in 8085
6. SUB R/M 7. SBB R/M
• Subtract register or memory from • Subtract register or memory with
accumulator borrow from accumulator Subtracts the
• The contents of a register or memory contents of the register or memory
are subtracted from the accumulator. along with the borrow (carry) flag from
The result is stored in the accumulator, the accumulator.
and all flags are affected. • Example: SBB B (Subtracts register B
• Example: SUB B (Subtracts the contents and borrow flag from the accumulator)
of register B from the accumulator)
Types of Aritmetic Instructions in 8085
8. SUI 8-bit data 9. SBI 8-bit data
• Subtract immediate 8-bit data from • Subtract immediate 8-bit data with
accumulator borrow from accumulator
• The 8-bit immediate data is subtracted • Subtracts the 8-bit immediate data and
from the accumulator. borrow (carry) flag from the
• Example: SUI 45H (Subtracts immediate accumulator.
value 45H from the accumulator). • Example: SBI 45H (Subtracts 45H and
the borrow flag from the accumulator)
Types of Aritmetic Instructions in 8085
10. INR R/M 11. INX R -
• ncrement register or memory by 1 • Increment register pair by 1
Increments the contents of a register or Increments the contents of the specified
memory by 1. register pair by 1.
• All flags are affected except for the • No flags are affected.
Carry flag. • Example: INX H (Increments the HL
• Example: INR B (Increments the value in register pair by 1).
register B by 1).
04
Logical
instruction
• Logica l instruc tions refer to operati ons that are based on
logical relation s, primari ly in the contex t of program ming,
compu ter archite cture, and mathem atics.
• Logica l instruc tions deal with manipu lating binary values
(0s and 1s) using logical operati ons, which form the
basis of decisio n-maki ng proces ses in compu ters.
• These instruc tions follow the princip les of Boolea n
algebra .
Types of Logical Instructions in 8085
1. ANA R/M (Logical AND with 2. ANI 8-bit data (Logical AND immediate
Accumulator) with Accumulator)
• Logical AND between accumulator and • Operation: Logical AND between
register/memory. accumulator and immediate 8-bit data.
• Flags: S, Z, P modified; CY is reset; AC is • Flags: S, Z, P modified; CY is reset; AC is
set. set.
• Example: ANA B, ANA M. • Example: ANI 86H.
Types of Logical Instructions in 8085
3. XRA R/M (Exclusive OR with 4. XRI 8-bit data (Exclusive OR immediate
Accumulator) with Accumulator)
• Operation: XOR between accumulator • Operation: XOR between accumulator
and register/memory. and immediate 8-bit data.
• Flags: S, Z, P modified; CY and AC reset. • Flags: S, Z, P modified; CY and AC reset.
• Example: XRA B, XRA M. • Example: XRI 86H.
Types of Logical Instructions in 8085
5. ORA R/M (Logical OR with Accumulator) 6. ORI 8-bit data (Logical OR immediate
• Operation: Logical OR between with Accumulator)
accumulator and register/memory. • Operation: Logical OR between
• Flags: S, Z, P modified; CY and AC reset. accumulator and immediate 8-bit data.
• Example: ORA B, ORA M. • Flags: S, Z, P modified; CY and AC reset.
• Example: ORI 86H.
Types of Logical Instructions in 8085
7. CMP R/M (Compare with Accumulator) 8. CPI 8-bit data (Compare immediate
• Operation: Compare accumulator with with Accumulator)
register/memory. • Operation: Compare accumulator with
• Flags: immediate 8-bit data.
If A < operand: CY is set. • Flags:
If A = operand: Z is set. If A < data: CY is set.
If A > operand: CY and Z are reset. If A = data: Z is set.
• Example: CMP B, CMP M. If A > data: CY and Z are reset.
• Example: CPI 89H.
Types of Logical Instructions in 8085
9. RLC (Rotate Accumulator Left) 10. RRC (Rotate Accumulator Right)
• Operation: Rotate accumulator left by 1 • Operation: Rotate accumulator right by
bit. D7 moves to D0 and Carry flag. 1 bit. D0 moves to D7 and Carry flag.
• Flags: CY is modified; S, Z, P, AC • Flags: CY is modified; S, Z, P, AC
unaffected. unaffected.
• Example: RLC. • Example: RRC.
Types of Logical Instructions in 8085
11. RAL (Rotate Left Through Carry) 12. RAR (Rotate Right Through Carry)
• Operation: Rotate accumulator left • Operation: Rotate accumulator right
through Carry flag. through Carry flag.
• Flags: CY is modified; S, Z, P, AC • Flags: CY is modified; S, Z, P, AC
unaffected. unaffected.
• Example: RAL. • Example: RAR.
THANK
YOU