SlideShare a Scribd company logo
1 of 39
Download to read offline
Chapter 6
Introduction to 8085
Instructions
1
2
8085 Instruction Set
The 8085 instructions can be classified as follows:
 Data transfer operations
 Arithmetic operations (ADD, SUB, INR, DCR)
 Logic operations
 Branching operations (JMP, CALL, RET)
 Machine Control Operations
• Between registers
• Between memory location and a register
• Direct write to a register / memory
• Between I/O device and accumulator
Data Transfer Operations
• These operations simply COPY the data from the source to the destination.
• MOV, MVI, IN, OUT
• They transfer:
• Data between registers.
• Data Byte to a register or memory location.
• Data between a memory location and a register.
• Data between an IO Device and the accumulator.
• The data in the source is not changed.
3
4
Simple Data Transfer Operations
Examples:
 MOV B,A 47 From ACC to REG
 MOV C,D 4A Between two REGs
 MVI D,47 16 Direct-write into REG D
47
5
Simple Data Transfer Operations
Example:
 OUT 05 D3
05
Contents of ACC sent to output port number 05.
Machine Control Operations• HLT: Halt
• This is 1 byte instruction
• The processor stops executing and enters wait state
• NOP: No Operation
• This is a 1-byte instruction
• No operation is performed
6
REVIEW OF IMPORTANT CONCEPTS• REGISTERS ARE USED TO LOAD DATA DIRECTLY OR TO SAVE DATA
BYTES.
• IN DATA TRANSFER (COPYING) THE DESTINATION REGISTER IS
MODIFIED BUT THE SOURCE REGISTER RETAINS ITS DATA.
• THE 8085 TRANSFERS DATA FROM AN INPUT PORT TO THE
ACCUMULATOR (IN) AND FROM THE ACCUMULATOR TO AN
OUTPUT PORT (OUT). THE INSTRUCTION OUT CANNOT SEND DATA
FROM ANY OTHER REGISTER.
• IN THE 8085 PROCESSOR, DATA TRANSFER INSTRUCTION DO NOT
AFFECT THE FLAGS.
7
Example 6.1
• Load the accumulator A with the data byte 82h. And save the data in
register B.
8
Example 6.1
• Load the accumulator A with the data byte 82h. And save the data in
register B.
• MVI A, 82H.
• MOV B, A
• The first instruction is a 2-byte instruction that loads the accumulator
with the data byte 82h., and the second instruction copies the
contents of the accumulator in register B without changing the
contents of the accumulator.
9
Reading Data at Input Port and Sending Data to Output Port
10
11
Example 6.2
• Write instructions to read eight ON/OFF switches connected to the
input with the address 00H. And turn on the devices connected to the
output port with the address 01H. As shown in figure.
• IN 00H.
• OUT 01H.
• HLT
12
Arithmetic Operations
• Addition (ADD, ADI):
• Any 8-bit number.
• The contents of a register.
• The contents of a memory location.
• Can be added to the contents of the accumulator and the result is stored in the
accumulator.
• Subtraction (SUB, SUI):
• Any 8-bit number
• The contents of a register
• The contents of a memory location
• Can be subtracted from the contents of the accumulator. The result is stored in the
accumulator.
13
14
Arithmetic Operations
Arithmetic Operations
• Increment (INR) and Decrement (DCR):
• The 8-bit contents of any memory location or any register can be directly incremented or
decremented by 1.
• No need to disturb the contents of the accumulator.
• Affect all flags except the CY flag.
15
S Z AC P CY
D7 D6 D5 D4 D3 D2 D1 D0
16
Arithmetic Operations
17
Example 6.3
• Add the number 35H. Directly to the sum in the previous example when the CY flag is
set.
• ADI 35H.
18
Example 6.4
0 0 0
S Z CY
Flag Status
0 0 1 1 0 1 0 1
0 1 0 0 1 0 1 0
35
4A
0 1 1 1 1 1 1 17F
Data
A
A
+
||
1
CY
0
CY
19
Arithmetic Operations
REVIEW OF IMPORTANT CONCEPTS• The arithmetic operations implicitly assume that the contents of the accumulator are one of the
operands.
• The result of the arithmetic operations are stored in the accumulator; thus, the previous contents
of the content of the accumulator are altered.
• The flags are modified to reflect the data conditions of an operation.
• In the Add operation, if the sum is larger than 8-bit CY is set.
• The Substract operation is performed by using the 2’s complement method.
• If a substraction results in a negative number, the answersis in 2’s complement and CY (the Borrow
flag)
• In unsigned arithmetic operations, the Sign flag (S) should be ignored.
• The instructions INR and DCR are special cases of the arithmetic operations. These instructions can
be used for any of the registers, and they do not affect CY, even if the result is larger than 8-bit. All
other flags are affected by the result in the register used (not by the contents of the accumulator).
20
Logic Operations
• These instructions perform logic operations on the contents of the accumulator.
• ANA, ANI, ORA, ORI, XRA and XRI
• Source: Accumulator and
• An 8-bit number
• The contents of a register
• The contents of a memory location
• Destination: Accumulator
ANA R/M AND Accumulator With Reg/Mem
ANI # AND Accumulator With an 8-bit number
ORA R/M OR Accumulator With Reg/Mem
ORI # OR Accumulator With an 8-bit number
XRA R/M XOR Accumulator With Reg/Mem
XRI # XOR Accumulator With an 8-bit number
21
22
Logic Operations
23
Logic Operations
24
Logic Operations
25
Overview of Logic Operations
Data Masking With Logic AND
26
Branch Operations
• Three Types
• Jump instructions
• Call and Return Instructions
• Restart Instructions
27
JUMP Instructions
• Two types:
• Unconditional jump.
• Go to a new location no matter what.
• JMP Address
• Jump to the address specified (Go to).
• Conditional jump.
• Go to a new location if the condition is true.
• The addresses supplied to all branch operations must be 16-bits.
28
29
Branching Operations
Note: This is an unconditional jump operation.
It will always force the program counter to a fixed
memory address continuous loop !
30
Branching Operations
Conditional jump operations are very useful for decision
making during the execution of the program.
Conditional Jump
• Go to new location if a specified condition is met.
• JZ Address (Jump on Zero)
• Go to address specified if the Zero flag is set.
• JNZ Address (Jump on NOT Zero)
• Go to address specified if the Zero flag is not set.
• JC Address (Jump on Carry)
• Go to the address specified if the Carry flag is set.
• JNC Address (Jump on No Carry)
• Go to the address specified if the Carry flag is not set.
• JP Address (Jump on Plus)
• Go to the address specified if the Sign flag is not set
• JM Address (Jump on Minus)
• Go to the address specified if the Sign flag is set.
31
32
Example
Write a 8085 machine code program:
 Read two different memory locations (2050H.
& 2051H.)
 Add the contents
 Send the result to output port 02 (display)
if there is no overflow
 Display “FF” if there is an overflow
 Stop
Assume that the 8085 program begin at
2000H.
33
Example
2000 LDA 2050 3A
2001 50
2002 20
2003 MOV B,A 47
2004 LDA 2051 3A
2005 51
2006 20
2007 ADD B 80
2008 JNC XXYY D2
2009 YY
2010 XX
2011 MVI A,FF 3E
2012 FF
2013 OUT 02 D3
2014 02
2015 HLT 76
Load contents of memory
location 2050 into accumulator
Load contents of memory
location 2051 into accumulator
Save the first number in B
Add accumulator with B
Jump to YYXX if no carry !
Direct write FF into
accumulator
Display accumulator contents
at output port 02
Stop
34
Updated Code
2000 LDA 2050 3A
2001 50
2002 20
2003 MOV B,A 47
2004 LDA 2051 3A
2005 51
2006 20
2007 ADD B 80
2008 JNC 2013 D2
2009 13
2010 20
2011 MVI A,FF 3E
2012 FF
2013 OUT 02 D3
2014 02
2015 HLT 76
Load contents of memory
location 2050 into accumulator
Load contents of memory
location 2051 into accumulator
Save the first number in B
Add accumulator with B
Jump to 2013 if no carry !
Direct write FF into
accumulator
Display accumulator contents
at output port 02
Stop
Unconditional Branch
• CALL Address
• Jump to the address specified but treat it as a subroutine.
• RET
• Return from a subroutine.
• The addresses supplied to all branch operations must be 16-bits.
35
Conditional Call
• Go to new location if a specified condition is met.
• CZ Address (Jump on Zero)
• Call subroutine if the Zero flag is set.
• CNZ Address (Jump on NOT Zero)
• Call subroutine if the Zero flag is not set.
• CC Address (Jump on Carry)
• Call subroutine if the Carry flag is set.
• CNC Address (Jump on No Carry)
• Call subroutine if the Carry flag is not set.
• CP Address (Jump on Plus)
• Call subroutine if the Sign flag is not set
• CM Address (Jump on Minus)
• Call subroutine if the Sign flag is set.
36
Conditional Return
• Go to new location if a specified condition is met.
• RZ Address (Jump on Zero)
• Return if the Zero flag is set.
• RNZ Address (Jump on NOT Zero)
• Return if the Zero flag is not set.
• RC Address (Jump on Carry)
• Return if the Carry flag is set.
• RNC Address (Jump on No Carry)
• Return if the Carry flag is not set.
• RP Address (Jump on Plus)
• Return if the Sign flag is not set
• RM Address (Jump on Minus)
• Return if the Sign flag is set.
37
Machine Control
• HLT
• Stop executing the program.
• NOP
• No operation
• Exactly as it says, do nothing.
• Usually used for delay or to replace instructions during debugging.
38
39
The Algorithm of the program
1: total = 0, i = 0
2: i = i + 1
3: total = total + i
4: IF i  n THEN GOTO 2
n + (n - 1) + … + 1
The 8085 coding of the program
LDA n
MOV B, A
XRA A
Loop: ADD B
DCR B
JNZ Loop
STA total
• Example program using 8085 microprocessor coding
i = n
sum = A  A = 0
sum = sum + i
i = i - 1
IF i  0 THEN GOTO Loop
total = sum

More Related Content

What's hot

Microprocessor 8085 Chapter 4
Microprocessor 8085 Chapter 4Microprocessor 8085 Chapter 4
Microprocessor 8085 Chapter 4Rishikesh Bhavsar
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdfSrikrishna Thota
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiMuhammad Abdullah
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE Dr.YNM
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessorKashyap Shah
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
Msp 430 addressing modes module 2
Msp 430 addressing modes module 2Msp 430 addressing modes module 2
Msp 430 addressing modes module 2SARALA T
 
80286 microprocessor
80286 microprocessor80286 microprocessor
80286 microprocessorAvin Mathew
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architectureDr.YNM
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255Marajulislam3
 

What's hot (20)

8254 presentation
8254 presentation8254 presentation
8254 presentation
 
Microprocessor 8085 Chapter 4
Microprocessor 8085 Chapter 4Microprocessor 8085 Chapter 4
Microprocessor 8085 Chapter 4
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Uart
UartUart
Uart
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
UART
UARTUART
UART
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Msp 430 addressing modes module 2
Msp 430 addressing modes module 2Msp 430 addressing modes module 2
Msp 430 addressing modes module 2
 
80286 microprocessor
80286 microprocessor80286 microprocessor
80286 microprocessor
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
8051 interrupts
8051 interrupts8051 interrupts
8051 interrupts
 
8255 PPI
8255 PPI8255 PPI
8255 PPI
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255
 

Viewers also liked

Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Javacmkandemir
 
PHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlerPHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlercmkandemir
 
JDK and Eclipse Installation and Configuration
JDK and Eclipse Installation and ConfigurationJDK and Eclipse Installation and Configuration
JDK and Eclipse Installation and Configurationcmkandemir
 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructionscmkandemir
 
İnternet Tabanlı Programlama Uygulama Notları
İnternet Tabanlı Programlama Uygulama Notlarıİnternet Tabanlı Programlama Uygulama Notları
İnternet Tabanlı Programlama Uygulama Notlarıcmkandemir
 
openCV and Java - Face Detection
openCV and Java - Face DetectionopenCV and Java - Face Detection
openCV and Java - Face Detectioncmkandemir
 
impress.js Framework
impress.js Frameworkimpress.js Framework
impress.js Frameworkcmkandemir
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2cmkandemir
 
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, FonksiyonlarKod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, Fonksiyonlarcmkandemir
 
Threads and Game Programming In Java
Threads and Game Programming In JavaThreads and Game Programming In Java
Threads and Game Programming In Javacmkandemir
 
Web Sitesi Geliştirme Adımları
Web Sitesi Geliştirme AdımlarıWeb Sitesi Geliştirme Adımları
Web Sitesi Geliştirme Adımlarıcmkandemir
 
CSS Uygulamaları 1
CSS Uygulamaları 1CSS Uygulamaları 1
CSS Uygulamaları 1cmkandemir
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1cmkandemir
 
CSS - Sunum Bileşenleri
CSS - Sunum BileşenleriCSS - Sunum Bileşenleri
CSS - Sunum Bileşenlericmkandemir
 

Viewers also liked (15)

Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Java
 
PHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlerPHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemler
 
JDK and Eclipse Installation and Configuration
JDK and Eclipse Installation and ConfigurationJDK and Eclipse Installation and Configuration
JDK and Eclipse Installation and Configuration
 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructions
 
İnternet Tabanlı Programlama Uygulama Notları
İnternet Tabanlı Programlama Uygulama Notlarıİnternet Tabanlı Programlama Uygulama Notları
İnternet Tabanlı Programlama Uygulama Notları
 
PHP Temelleri
PHP TemelleriPHP Temelleri
PHP Temelleri
 
openCV and Java - Face Detection
openCV and Java - Face DetectionopenCV and Java - Face Detection
openCV and Java - Face Detection
 
impress.js Framework
impress.js Frameworkimpress.js Framework
impress.js Framework
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
 
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, FonksiyonlarKod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
 
Threads and Game Programming In Java
Threads and Game Programming In JavaThreads and Game Programming In Java
Threads and Game Programming In Java
 
Web Sitesi Geliştirme Adımları
Web Sitesi Geliştirme AdımlarıWeb Sitesi Geliştirme Adımları
Web Sitesi Geliştirme Adımları
 
CSS Uygulamaları 1
CSS Uygulamaları 1CSS Uygulamaları 1
CSS Uygulamaları 1
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
 
CSS - Sunum Bileşenleri
CSS - Sunum BileşenleriCSS - Sunum Bileşenleri
CSS - Sunum Bileşenleri
 

Similar to Chapter 6 - Introduction to 8085 Instructions

8085 microprocessor(1)
8085 microprocessor(1)8085 microprocessor(1)
8085 microprocessor(1)Reevu Pal
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085Mani Afranzio
 
microprocessor ppt (branching and logical instructions)
microprocessor ppt (branching and logical instructions)microprocessor ppt (branching and logical instructions)
microprocessor ppt (branching and logical instructions)Nemish Bhojani
 
8085 instruction set and Programming
8085 instruction set and Programming 8085 instruction set and Programming
8085 instruction set and Programming pooja saini
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modesSuchismita Paul
 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3Sajan Agrawal
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01cairo university
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setprakash y
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptssuser2ae35a
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
 
Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!PRABHAHARAN429
 
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Randa Elanwar
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085Shifali Sharma
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller nitugatkal
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdfHimanshuPant41
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterKatrina Little
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).pptKanikaJindal9
 

Similar to Chapter 6 - Introduction to 8085 Instructions (20)

8085 microprocessor(1)
8085 microprocessor(1)8085 microprocessor(1)
8085 microprocessor(1)
 
5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085
 
microprocessor ppt (branching and logical instructions)
microprocessor ppt (branching and logical instructions)microprocessor ppt (branching and logical instructions)
microprocessor ppt (branching and logical instructions)
 
8085 instruction set and Programming
8085 instruction set and Programming 8085 instruction set and Programming
8085 instruction set and Programming
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8085 instructions and addressing modes
8085 instructions and addressing modes8085 instructions and addressing modes
8085 instructions and addressing modes
 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3
 
Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01Lecture 4 (8051 instruction set) rv01
Lecture 4 (8051 instruction set) rv01
 
13229286.ppt
13229286.ppt13229286.ppt
13229286.ppt
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
instructions set of 8051.pdf
instructions set of 8051.pdfinstructions set of 8051.pdf
instructions set of 8051.pdf
 
lecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.pptlecture25_algorithmic_state_machines.ppt
lecture25_algorithmic_state_machines.ppt
 
Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)Introduction to 8085 & it's description(includes basic lab experiments)
Introduction to 8085 & it's description(includes basic lab experiments)
 
Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!
 
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt
 

More from cmkandemir

Temel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım ÖrnekleriTemel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım Örneklericmkandemir
 
Yapay Zeka Nedir?
Yapay Zeka Nedir?Yapay Zeka Nedir?
Yapay Zeka Nedir?cmkandemir
 
Zekayı Anlamak
Zekayı AnlamakZekayı Anlamak
Zekayı Anlamakcmkandemir
 
PHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesiPHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesicmkandemir
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systemscmkandemir
 
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly LanguageChapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly Languagecmkandemir
 
CSS - Genel Bakış
CSS - Genel BakışCSS - Genel Bakış
CSS - Genel Bakışcmkandemir
 
Temel HTML Etiketleri - Tablo, Form
Temel HTML Etiketleri - Tablo, FormTemel HTML Etiketleri - Tablo, Form
Temel HTML Etiketleri - Tablo, Formcmkandemir
 
Temel HTML Etiketleri - Text, Image, Link, List, Image
Temel HTML Etiketleri - Text, Image, Link, List, ImageTemel HTML Etiketleri - Text, Image, Link, List, Image
Temel HTML Etiketleri - Text, Image, Link, List, Imagecmkandemir
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainercmkandemir
 

More from cmkandemir (10)

Temel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım ÖrnekleriTemel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım Örnekleri
 
Yapay Zeka Nedir?
Yapay Zeka Nedir?Yapay Zeka Nedir?
Yapay Zeka Nedir?
 
Zekayı Anlamak
Zekayı AnlamakZekayı Anlamak
Zekayı Anlamak
 
PHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesiPHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesi
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
 
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly LanguageChapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
 
CSS - Genel Bakış
CSS - Genel BakışCSS - Genel Bakış
CSS - Genel Bakış
 
Temel HTML Etiketleri - Tablo, Form
Temel HTML Etiketleri - Tablo, FormTemel HTML Etiketleri - Tablo, Form
Temel HTML Etiketleri - Tablo, Form
 
Temel HTML Etiketleri - Text, Image, Link, List, Image
Temel HTML Etiketleri - Text, Image, Link, List, ImageTemel HTML Etiketleri - Text, Image, Link, List, Image
Temel HTML Etiketleri - Text, Image, Link, List, Image
 
Vaadin JPAContainer
Vaadin JPAContainerVaadin JPAContainer
Vaadin JPAContainer
 

Recently uploaded

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Chapter 6 - Introduction to 8085 Instructions

  • 1. Chapter 6 Introduction to 8085 Instructions 1
  • 2. 2 8085 Instruction Set The 8085 instructions can be classified as follows:  Data transfer operations  Arithmetic operations (ADD, SUB, INR, DCR)  Logic operations  Branching operations (JMP, CALL, RET)  Machine Control Operations • Between registers • Between memory location and a register • Direct write to a register / memory • Between I/O device and accumulator
  • 3. Data Transfer Operations • These operations simply COPY the data from the source to the destination. • MOV, MVI, IN, OUT • They transfer: • Data between registers. • Data Byte to a register or memory location. • Data between a memory location and a register. • Data between an IO Device and the accumulator. • The data in the source is not changed. 3
  • 4. 4 Simple Data Transfer Operations Examples:  MOV B,A 47 From ACC to REG  MOV C,D 4A Between two REGs  MVI D,47 16 Direct-write into REG D 47
  • 5. 5 Simple Data Transfer Operations Example:  OUT 05 D3 05 Contents of ACC sent to output port number 05.
  • 6. Machine Control Operations• HLT: Halt • This is 1 byte instruction • The processor stops executing and enters wait state • NOP: No Operation • This is a 1-byte instruction • No operation is performed 6
  • 7. REVIEW OF IMPORTANT CONCEPTS• REGISTERS ARE USED TO LOAD DATA DIRECTLY OR TO SAVE DATA BYTES. • IN DATA TRANSFER (COPYING) THE DESTINATION REGISTER IS MODIFIED BUT THE SOURCE REGISTER RETAINS ITS DATA. • THE 8085 TRANSFERS DATA FROM AN INPUT PORT TO THE ACCUMULATOR (IN) AND FROM THE ACCUMULATOR TO AN OUTPUT PORT (OUT). THE INSTRUCTION OUT CANNOT SEND DATA FROM ANY OTHER REGISTER. • IN THE 8085 PROCESSOR, DATA TRANSFER INSTRUCTION DO NOT AFFECT THE FLAGS. 7
  • 8. Example 6.1 • Load the accumulator A with the data byte 82h. And save the data in register B. 8
  • 9. Example 6.1 • Load the accumulator A with the data byte 82h. And save the data in register B. • MVI A, 82H. • MOV B, A • The first instruction is a 2-byte instruction that loads the accumulator with the data byte 82h., and the second instruction copies the contents of the accumulator in register B without changing the contents of the accumulator. 9
  • 10. Reading Data at Input Port and Sending Data to Output Port 10
  • 11. 11
  • 12. Example 6.2 • Write instructions to read eight ON/OFF switches connected to the input with the address 00H. And turn on the devices connected to the output port with the address 01H. As shown in figure. • IN 00H. • OUT 01H. • HLT 12
  • 13. Arithmetic Operations • Addition (ADD, ADI): • Any 8-bit number. • The contents of a register. • The contents of a memory location. • Can be added to the contents of the accumulator and the result is stored in the accumulator. • Subtraction (SUB, SUI): • Any 8-bit number • The contents of a register • The contents of a memory location • Can be subtracted from the contents of the accumulator. The result is stored in the accumulator. 13
  • 15. Arithmetic Operations • Increment (INR) and Decrement (DCR): • The 8-bit contents of any memory location or any register can be directly incremented or decremented by 1. • No need to disturb the contents of the accumulator. • Affect all flags except the CY flag. 15 S Z AC P CY D7 D6 D5 D4 D3 D2 D1 D0
  • 18. • Add the number 35H. Directly to the sum in the previous example when the CY flag is set. • ADI 35H. 18 Example 6.4 0 0 0 S Z CY Flag Status 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 35 4A 0 1 1 1 1 1 1 17F Data A A + || 1 CY 0 CY
  • 20. REVIEW OF IMPORTANT CONCEPTS• The arithmetic operations implicitly assume that the contents of the accumulator are one of the operands. • The result of the arithmetic operations are stored in the accumulator; thus, the previous contents of the content of the accumulator are altered. • The flags are modified to reflect the data conditions of an operation. • In the Add operation, if the sum is larger than 8-bit CY is set. • The Substract operation is performed by using the 2’s complement method. • If a substraction results in a negative number, the answersis in 2’s complement and CY (the Borrow flag) • In unsigned arithmetic operations, the Sign flag (S) should be ignored. • The instructions INR and DCR are special cases of the arithmetic operations. These instructions can be used for any of the registers, and they do not affect CY, even if the result is larger than 8-bit. All other flags are affected by the result in the register used (not by the contents of the accumulator). 20
  • 21. Logic Operations • These instructions perform logic operations on the contents of the accumulator. • ANA, ANI, ORA, ORI, XRA and XRI • Source: Accumulator and • An 8-bit number • The contents of a register • The contents of a memory location • Destination: Accumulator ANA R/M AND Accumulator With Reg/Mem ANI # AND Accumulator With an 8-bit number ORA R/M OR Accumulator With Reg/Mem ORI # OR Accumulator With an 8-bit number XRA R/M XOR Accumulator With Reg/Mem XRI # XOR Accumulator With an 8-bit number 21
  • 25. 25 Overview of Logic Operations
  • 26. Data Masking With Logic AND 26
  • 27. Branch Operations • Three Types • Jump instructions • Call and Return Instructions • Restart Instructions 27
  • 28. JUMP Instructions • Two types: • Unconditional jump. • Go to a new location no matter what. • JMP Address • Jump to the address specified (Go to). • Conditional jump. • Go to a new location if the condition is true. • The addresses supplied to all branch operations must be 16-bits. 28
  • 29. 29 Branching Operations Note: This is an unconditional jump operation. It will always force the program counter to a fixed memory address continuous loop !
  • 30. 30 Branching Operations Conditional jump operations are very useful for decision making during the execution of the program.
  • 31. Conditional Jump • Go to new location if a specified condition is met. • JZ Address (Jump on Zero) • Go to address specified if the Zero flag is set. • JNZ Address (Jump on NOT Zero) • Go to address specified if the Zero flag is not set. • JC Address (Jump on Carry) • Go to the address specified if the Carry flag is set. • JNC Address (Jump on No Carry) • Go to the address specified if the Carry flag is not set. • JP Address (Jump on Plus) • Go to the address specified if the Sign flag is not set • JM Address (Jump on Minus) • Go to the address specified if the Sign flag is set. 31
  • 32. 32 Example Write a 8085 machine code program:  Read two different memory locations (2050H. & 2051H.)  Add the contents  Send the result to output port 02 (display) if there is no overflow  Display “FF” if there is an overflow  Stop Assume that the 8085 program begin at 2000H.
  • 33. 33 Example 2000 LDA 2050 3A 2001 50 2002 20 2003 MOV B,A 47 2004 LDA 2051 3A 2005 51 2006 20 2007 ADD B 80 2008 JNC XXYY D2 2009 YY 2010 XX 2011 MVI A,FF 3E 2012 FF 2013 OUT 02 D3 2014 02 2015 HLT 76 Load contents of memory location 2050 into accumulator Load contents of memory location 2051 into accumulator Save the first number in B Add accumulator with B Jump to YYXX if no carry ! Direct write FF into accumulator Display accumulator contents at output port 02 Stop
  • 34. 34 Updated Code 2000 LDA 2050 3A 2001 50 2002 20 2003 MOV B,A 47 2004 LDA 2051 3A 2005 51 2006 20 2007 ADD B 80 2008 JNC 2013 D2 2009 13 2010 20 2011 MVI A,FF 3E 2012 FF 2013 OUT 02 D3 2014 02 2015 HLT 76 Load contents of memory location 2050 into accumulator Load contents of memory location 2051 into accumulator Save the first number in B Add accumulator with B Jump to 2013 if no carry ! Direct write FF into accumulator Display accumulator contents at output port 02 Stop
  • 35. Unconditional Branch • CALL Address • Jump to the address specified but treat it as a subroutine. • RET • Return from a subroutine. • The addresses supplied to all branch operations must be 16-bits. 35
  • 36. Conditional Call • Go to new location if a specified condition is met. • CZ Address (Jump on Zero) • Call subroutine if the Zero flag is set. • CNZ Address (Jump on NOT Zero) • Call subroutine if the Zero flag is not set. • CC Address (Jump on Carry) • Call subroutine if the Carry flag is set. • CNC Address (Jump on No Carry) • Call subroutine if the Carry flag is not set. • CP Address (Jump on Plus) • Call subroutine if the Sign flag is not set • CM Address (Jump on Minus) • Call subroutine if the Sign flag is set. 36
  • 37. Conditional Return • Go to new location if a specified condition is met. • RZ Address (Jump on Zero) • Return if the Zero flag is set. • RNZ Address (Jump on NOT Zero) • Return if the Zero flag is not set. • RC Address (Jump on Carry) • Return if the Carry flag is set. • RNC Address (Jump on No Carry) • Return if the Carry flag is not set. • RP Address (Jump on Plus) • Return if the Sign flag is not set • RM Address (Jump on Minus) • Return if the Sign flag is set. 37
  • 38. Machine Control • HLT • Stop executing the program. • NOP • No operation • Exactly as it says, do nothing. • Usually used for delay or to replace instructions during debugging. 38
  • 39. 39 The Algorithm of the program 1: total = 0, i = 0 2: i = i + 1 3: total = total + i 4: IF i  n THEN GOTO 2 n + (n - 1) + … + 1 The 8085 coding of the program LDA n MOV B, A XRA A Loop: ADD B DCR B JNZ Loop STA total • Example program using 8085 microprocessor coding i = n sum = A  A = 0 sum = sum + i i = i - 1 IF i  0 THEN GOTO Loop total = sum