Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

8085 Instructions &

Programming concept
Instruction set of 8085
✓Five type of instructions
1. Data transfer instructions
2. Arithmetic instructions
3. Logic instructions
4. Branch instructions
5. Machine control instructions

Kantaria Mehul
Logical instructions
OPCODE OPERAND DISCRIPTION

ANA R AND operation between content of A & R


ANA B : A (AND) B → A
CY =0 & AC=1

ANI 8-bit data AND operation between content of A & 8-bit data
ANI 11H : A (AND) 11 → A
CY =0 & AC=1

ORA R OR operation between content of A & R


ORA B : A (OR) B → A
CY =0

ORI 8-bit data OR operation between content of A & 8-bit data


ORI 11H : A (OR) 11 → A
CY =0

Kantaria Mehul
Logical instructions
OPCODE OPERAND DISCRIPTION

XRA R X-OR operation between content of A & R


XRA B : A (X-OR) B → A
CY =0

XRI 8-bit data X-OR operation between content of A & 8-bit data
XRI 11H : A (X-OR) 11 → A
CY =0

CMA - Complement Accumulator data


No flags are affected

CMP R Compare data in R or M (Address in HL) with Accumulator (A - R/M)


M A < R/M: S=1 & Z=0
A > R/M: S=0 & Z=0
A = R/M: S=0 & Z=1

CPI 8-bit data Compare data of Accumulator with 8-bit data


A - 8-bit data → S & Z as per CMP
Kantaria Mehul
Logical instructions
Logical instructions
OPCODE OPERAND DISCRIPTION

CMC - Complement the CY flag


CY=0
CMC
CY=1

STC - Set CY flag


CY=X
STC
CY=1

Kantaria Mehul
Logical instructions
✓Operations
✓ANA : AND AND operation between A & Register
✓ANI : AND immediate AND operation between A & 8-bit data
✓ORA : OR OR operation between A & Register
✓ORI : OR immediate OR operation between A & 8-bit data
✓XRA : X-OR X-OR operation between A & Register
✓XRI : X-OR immediate X-OR operation between A & 8-bit data
✓CMA : Complement A 1’s complement of content of accumulator
✓CMP : Compare with accumulator
✓CPI : Compare immediate with accumulator

* Reset the CY flag CY=0


* Z,P and S are modified according answer
Kantaria Mehul
Logical instructions
✓Operations
✓RAL : Rotate Accumulator Left include carry in rotate operation
✓RAR : Rotate Accumulator Right include carry in rotate operation
✓RLC : Rotate Accumulator Left copy d7 in CY but not included in rotate op.
✓RRC : Rotate Accumulator Right copy d0 in CY but not included in rotate op.
✓CMC : Complement the CY 1’s complement of CY
✓STC : Set the CY CY=1

Kantaria Mehul

You might also like