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

Lecture # 07 - 08

The document provides an overview of assembly language and instruction sets for the 8085 microprocessor, highlighting the use of mnemonics for easier programming. It covers various instruction types, including data transfer, arithmetic, logical, branching, and control instructions, along with examples for each. Additionally, it explains the structure of assembly language instructions and the process of translating them into machine code.
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)
8 views

Lecture # 07 - 08

The document provides an overview of assembly language and instruction sets for the 8085 microprocessor, highlighting the use of mnemonics for easier programming. It covers various instruction types, including data transfer, arithmetic, logical, branching, and control instructions, along with examples for each. Additionally, it explains the structure of assembly language instructions and the process of translating them into machine code.
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/ 38

MICROPROCESSOR AND INTERFACING

TECHNIQUES

Department of Computer Systems Engineering

MEHRAN UET, JAMSHORO.

1
LECTURE # 07 ,08

ASSEMBLY LANGUAGE AND INSTRUCTION SET OF


MICROPROCESSOR 8085
2
LANGUAGE FOR WRITING INSTRUCTIONS :

 Entering the instructions using hexadecimal is quite easier


than entering the binary combinations.

 However, As a humane being it still is difficult to understand


the program written in hexadecimal .

 So, there must be solution of this problem……


SOLUTION OF PROBLEM (ASSEMBLY LANGUAGE) :

 Here is solution to overcome this problem.


 Each company defines a symbolic code for the instructions.
 These codes are called “mnemonics”.
 The mnemonic for each instruction is usually a group of letters
that suggest the operation performed.
ASSEMBLY LANGUAGE EXAMPLE :
 1000 0000,Which translates to 80 in
hexadecimal.
 Its mnemonic is “ADD B”.
 “Add register B to the accumulator and
keep the result in the accumulator”.
 It is easy to remember “ADD B” rather than 80.
ASSEMBLY LANGUAGE TRANSLATION :

 There Are Two Ways Of Assembly Language Translation.


Hand Assembly Use of Assembler

 The programmer translates each


 A program called an
assembly language instruction
“assembler”, which
into its equivalent hexadecimal
does the translation
code (machine language).
automatically.
 Then the hexadecimal code is
entered into memory.
ASSEMBLY LANGUAGE FORMAT :
 According to assembly language format each line is contains FOUR
parts. 1).Label 2).Opcode

 This is an optional field.  This field contains the mnemonic operation


 Name of Line is written here. code for the 8085 instruction to be
performed.
3).Operand 4).Comment
 It gives the data to be
operated on the specified op
 It contains explanation of instruction.
code.
ASSEMBLY LANGUAGE FORMAT :

 An Assembly program line for 8085:


INSTRUCTION :

 An instruction is a binary pattern designed inside


a microprocessor to perform a specific function.
 8085 has 246 instructions.
 Each instruction is represented by an 8-bit binary
value.
CLASSIFICATION OF INSTRUCTION SET :

There are 5 types of Data formats:


 (1) Data Transfer Instruction,
 (2) Arithmetic Instructions,
 (3) Logical Instructions,
 (4) Branching Instructions,
 (5) Control Instructions,
CLASSIFICATION OF INSTRUCTION SET :

Each instruction has two Parts:


 The first part is the task or operation to be performed this
part is called the “opcode” (operation code).
 The second part is the data to be operated on Called the
“operand”.
DATA TRANSFER INSTRUCTIONS
12
MOV (MOVE) INSTRUCTION :
 These instructions move data between registers, or between
memory and registers.
 These instructions copy data from source to destination.
 While copying, the contents of source are not modified.
 Example:
 MOV B,A
 MOV M,B
 MOV C,M
MVI (MOVE IMMEDIATE) INSTRUCTION :

 The 8-bit immediate data is stored (or transferred)in


the destination register or memory .

 Example:
 MVI B, 60H
 MVI M, 40H
LDA (LOAD ACCUMULATOR) INSTRUCTION :

 The contents of a memory location, specified by a 16-bit


address in the operand, are copied to the accumulator (A).
 Example:
 LDA 16-bit address
 LDA 2000H
ARITHMETIC INSTRUCTIONS
16
ARITHMETIC INSTRUCTION :

These instructions perform the operations like:


 Addition
 Subtraction
 Increment
 Decrement
ADD INSTRUCTION :

 The contents of register or memory are added to the


contents of accumulator.
 The result is stored in accumulator.
 Example:
 ADD C
 ADD M
ADC (ADD WITH CARRY) INSTRUCTION :

 The contents of register or memory and Carry Flag


(CY) are added to the contents of accumulator.
 The result is stored in accumulator.
 Example:
 ADC C ADC C
A=A+R+C
 ADC M
ADI (ADD IMMEDIATE) INSTRUCTION :

 The 8-bit data is added to the contents of accumulator.


 The result is stored in accumulator.
 Example:
 AD1 03H
 AD1 05H
INR (INCREMENT) INSTRUCTION :

 The contents of register or memory location are


incremented by 1 (ONE).
 The result is stored at the same place.
 Example:
 INR R
 INR M
LOGICAL INSTRUCTIONS
22
ANA (AND ACCUMULATOR) INSTRUCTION :

 It performs AND operation with accumulator and


other Register or Memory.
 The result is stored in accumulator.
 Example:
1010 1010
 ANA R 0000 1111

0000 1010
 ANA M
XRA (XOR ACCUMULATOR) INSTRUCTION :

 It performs XOR operation with accumulator and


other Register or Memory.
 The result is stored in accumulator.
 Example:
1010 1010
 XRA R 0010 1101

1000 0111
 XRA M
ORA (OR ACCUMULATOR) INSTRUCTION :

 It performs OR operation with accumulator and other


Register or Memory.
 The result is stored in accumulator.
 Example:
1010 1010
 ORA R 0001 0010

 ORA M 1011 1010


RLC INSTRUCTIONS :
 Rotate accumulator left
 Each binary bit of the accumulator is rotated left by one
position.
 Bit D7 is placed in the position of D0 as well as in the
Carry flag.
 CY is modified according to bit D7.

 Example: RLC.
RLC Instructions :
BEFORE EXECUTION

CY B7 B6 B5 B4 B3 B2 B1 B0

AFTER EXECUTION

B7 B6 B5 B4 B3 B2 B1 B0 B7
RRC INSTRUCTIONS

 Rotate accumulator right


 Each binary bit of the accumulator is rotated right by one
position.
 Bit D0 is placed in the position of D7 as well as in the
Carry flag.
 CY is modified according to bit D0.

 Example: RRC.
BEFORE EXECUTION

B7 B6 B5 B4 B3 B2 B1 B0 CY

AFTER EXECUTION

B0 B7 B6 B5 B4 B3 B2 B1 B0
BRANCHING INSTRUCTIONS
30
BRANCHING INSTRUCTIONS :

 The Branch group instructions allows the


microprocessor to change the sequence of program
either unconditionally or under certain test conditions.
 Example:
 JUMP
JMP (JUMP UNCONDITIONALLY ) INSTRUCTION :

 Jump unconditionally to the address.


 The instruction loads the PC with the address given
within the instruction .
 The program is transferred to the memory location
specified by 16 bit address.
 Example: JMP 2000H
BEFORE EXECUTION AFTER EXECUTION
PC JMP 2000H PC 2000
CONDITIONAL JUMP INSTRUCTION :

 The instruction loads the PC with the address given


within the instruction .
 The program is transferred to the memory location
specified by 16 bit address given in the operand based
on the specified flag (Condition Based ).
 Example: JZ 2000H
BEFORE EXECUTION AFTER EXECUTION
PC JZ 2000H PC 2000
CONDITIONAL JUMPS

Instruction Code Description Condition For Jump


JC Jump on carry CY=1
JNC Jump on not carry CY=0

JP Jump on positive S=0

JM Jump on minus S=1

JPE Jump on parity even P=1

JPO Jump on parity odd P=0

JZ Jump on zero Z=1

JNZ Jump on not zero Z=0


CONTROL INSTRUCTIONS
35
NOP ( NO OPERATION ) INSTRUCTION :

 No operation
 No operation is performed.
 The instruction is fetched and decoded but no
operation is executed.

 Example: NOP
HLT ( HALT ) INSRUCTION :

 Halt
 The CPU finishes executing the current
instruction and halts any further execution.

 Example: HLT
THE END !!!

38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy