0% found this document useful (0 votes)
4 views

Unit 2 Part B

The document provides an overview of the instruction set of the 8085 microprocessor, classifying instructions into categories such as Data Transfer, Arithmetic, Logical, Branching, Control, and I/O instructions. It also discusses assembler directives that guide the assembler during program assembly, detailing their functions and providing examples. Additionally, it includes a reference to a relevant textbook for further reading.

Uploaded by

VISHWAJEET TYAGI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unit 2 Part B

The document provides an overview of the instruction set of the 8085 microprocessor, classifying instructions into categories such as Data Transfer, Arithmetic, Logical, Branching, Control, and I/O instructions. It also discusses assembler directives that guide the assembler during program assembly, detailing their functions and providing examples. Additionally, it includes a reference to a relevant textbook for further reading.

Uploaded by

VISHWAJEET TYAGI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Unit 2

Part B
Introduction
 Instruction set of 8085
 Classification of Instruction set
– Data Transfer Instructions
– Arithmetic Instructions
– Logical Instructions
– Branching Instructions
– Control Instructions
Introduction
 Instruction set of 8085
 Classification of Instruction set
– Arithmetic Instructions
– Logical Instructions
Introduction

 Instruction set of 8085


 Classification of Instruction set
– Logical Instructions
PSW (Program Status word)
- Flag unaffected
* affected
0 reset
1 set
S Sign (Bit 7)
Z Zero (Bit 6)
AC Auxiliary Carry (Bit 4)
P Parity (Bit 2)
CY Carry (Bit 0)
circular Left shift
circular right shift
Summary – Data transfer
MOV Move
MVI Move Immediate
LDA Load Accumulator Directly from Memory
STA Store Accumulator Directly in Memory
LHLD Load H & L Registers Directly from Memory
SHLD Store H & L Registers Directly in Memory
Summary Data transfer
An 'X' in the name of a data transfer instruction implies that it deals
with a register pair (16-bits);

LXI Load Register Pair with Immediate data


LDAX Load Accumulator from Address in Register Pair
STAX Store Accumulator in Address in Register Pair
XCHG Exchange H & L with D & E
XTHL Exchange Top of Stack with H & L
Summary - Arithmetic Group
Add, Subtract, Increment / Decrement data in registers or memory.

ADD Add to Accumulator


ADI Add Immediate Data to Accumulator
ADC Add to Accumulator Using Carry Flag
ACI Add Immediate data to Accumulator Using Carry
SUB Subtract from Accumulator
SUI Subtract Immediate Data from Accumulator
SBB Subtract from Accumulator Using Borrow (Carry) Flag
SBI Subtract Immediate from Accumulator
Using Borrow (Carry) Flag
INR Increment Specified Byte by One
DCR Decrement Specified Byte by One
INX Increment Register Pair by One
DCX Decrement Register Pair by One
DAD Double Register Add; Add Content of Register Pair to H & L
Register Pair
Summary Logical Group
This group performs logical (Boolean) operations on data in registers and
memory and on condition flags.
These instructions enable you to set specific bits in the accumulator ON or
OFF.

ANA Logical AND with Accumulator


ANI Logical AND with Accumulator Using Immediate
Data
ORA Logical OR with Accumulator
OR Logical OR with Accumulator Using Immediate
Data
XRA Exclusive Logical OR with Accumulator
XRI Exclusive OR Using Immediate Data
The Compare instructions compare the content of an 8-bit value with the contents of
the accumulator;

CMP Compare
CPI Compare Using Immediate Data

The rotate instructions shift the contents of the accumulator one bit position to the
left or right:

RLC Rotate Accumulator Left


RRC Rotate Accumulator Right
RAL Rotate Left Through Carry
RAR Rotate Right Through Carry

Complement and carry flag instructions:

CMA Complement Accumulator


CMC Complement Carry Flag
STC Set Carry Flag
Summary - Branch Group

Unconditional branching
– JMP Jump
– CALL Call
– RET Return
Conditions
– NZ Not Zero (Z = 0)
– Z Zero (Z = 1)
– NC No Carry (C = 0)
– C Carry (C = 1)
– PO Parity Odd (P = 0)
– PE Parity Even (P = 1)
Summary - Stack

PUSH Push Two bytes of Data onto the Stack


POP Pop Two Bytes of Data off the Stack
XTHL Exchange Top of Stack with H & L
SPHL Move content of H & L to Stack Pointer
I/0 instructions

IN Initiate Input Operation


OUT Initiate Output Operation
Summary -Machine Control instructions

EI Enable Interrupt System


DI Disable Interrupt System
HLT Halt
NOP No Operation
Assembler Directives
• Assembly language has two types of statements:
• Executable statements- These are the statements to be executed by the processor.
• Assembler directives- These are the statements that direct the assembler to do
something. As the name says, it directs the assembler to do a task.
• The assembler directives are the instructions to the assembler concerning the
program being assembled.
• The assembler directives are also called pseudo instructions or pseudo opcodes.
• These instructions are neither translated to machine code nor assigned any memory
locations in the object file.
Assembler directives are effective only during the assembly of a program
but they do not generate any code that is machine executable.
Assembler Directives
Some functions of assembler directives are listed below:
The assembler directives are used
• To show the beginning of the program and end of the
program
• To provide storage locations to the data
• To give values to the variables
• To define the start and end of the different segments,
procedures or macros of the program
Assembler Directives
Some of the important assembler directive for an assembler are listed and described
here:
S. No. Assembler Example Description
Directive

1 ORG ORG 2000H The next block of the instruction should be stored in memory locations starting at 2000H
(origin)
2 END END End of assembly.

3 EQU PORT1 EQU 01H The value of the term PORT1 is equal to 01H. Generally, this means the PORT1 has the port
(Equate) INBUF EQU 2099H address 01H
The value of the term INBUF is 2099H. This may be the memory location used as the input
buffer.
4 DB DATA: DB A2H, 9FH Initializes an area byte by byte.
(Define Byte) OR This directive is used for the purpose of allocating and initializing single or multiple data
AREA: DB 30H, bytes.
52H, 35H Assembled bytes of the data are stored in successive memory locations until all the values are
stored. This is a convenient way of writing a data string. The level is optional.
Memory name AREA has three consecutive locations where 30H, 52H and 35H are to be
stored.
5 DW DW 2050H Initializes an area two bytes at a time
(Define
Word)
Assembler Directives
S. No. Assembler Example Description
Directive

6 DS OUTBUF: DS 4 Reserves a specified number of memory locations. In the example, four memory
(Define storage) locations are reserved for OUTBUF.

7 MACRO Shows the beginning of macro along with defining name and parameters.
where macroname (STEP) is specified by the user.

8 ENDM ENDM indicates the termination of macro.


Reference
• “Microprocessor Architecture, Programming, and Applications with
8085”, by Ramesh S. Gaonkar, Penram International Publishing

You might also like