SlideShare a Scribd company logo
1 of 19
8085 Architecture &
Its Assembly language programming
Dr A Sahu
Dept of Computer Science &
Engineering
IIT Guwahati
Outline
• 8085 Era and Features
• 8085
– Block diagram (Data Path)
– Bus Structure
– Register Structure
• Instruction Set of 8085
• Sample program of 8085
• Simulator & Kit for 8085
8085 Microprocessor
• 8 Bit CPU
• 3-6Mhz
• Simpler design: Single Cycle CPU
• ISA = Pre x86 design (Semi CISC)
• 40 Pin Dual line Package
• 16 bit address
• 6 registers: B, C, D, E, H,L
• Accumulator 8 bit
W Z
B C
D E
H L
SP
PC
Inc/Dec. ter
Add latch
MUX
Bus 8 Bit
Interrupt Control Serial I/O Control
IR
I Decode
&
M/C
Encodin
g
tmp RACC
Timing and Control
ALU
Add Buff Data/Add Buff
Flag
INTR INTA RST5.5
ReSeT6.5
RST7.5TRAP SID SOD
8085 Microprocessor Architecture
The 8085 Bus Structure
8085
MPU
A15
A0
D0
D7
Address Bus (16bit)
Memory I/P
Data Bus (8bit)
O/P
Control Bus (8bit)
8085 Bus Structure
• Address Bus : Consists of 16 address lines: A0 – A15
– Address locations: 0000 (hex) – FFFF (hex)
– Can access 64K ( = 216 ) bytes of memory, each byte has 8 bits
– Can access 64K  8 bits of memory
– Use memory to map I/O, Same instructions to use for
accessing I/O devices and memory
• Data Bus : Consists of 8 data lines: D0 – D7
– Operates in bidirectional mode
– The data bits are sent from the MPU to I/O & vice versa
– Data range: 00 (hex) – FF (hex)
• Control Bus:
– Consists of various lines carrying the control
signals such as read / write enable, flag bits
8085 Registers
• Registers:
– Six general purpose 8-bit registers: B, C, D, E, H,L
– Combined as register pairs to perform 16-bit
operations: BC, DE, HL
– Registers are programmable (load, move, etc.)
• Stack Pointer (SP)
• Accumulator & Flag Register
– (Zero, Sign, Carry, Parity, AuxCarry)
• Program Counter (PC)
– Contains the memory address (16 bits) of the
instruction that will be executed in the next step.
B C
D E
H L
SP
PC
How instruction executed
• All instructions (of a program) are stored in
memory.
• To run a program, the individual instructions
must be read from the memory in sequence,
and executed.
– Program counter puts the 16-bit memory address of the
instruction on the address bus
– Control unit sends the Memory Read Enable signal to access
the memory
– The 8-bit instruction stored in memory is placed on the data
bus and transferred to the instruction decoder
– Instruction is decoded and executed
Instruction Set of 8085
• Arithmetic Operations
– add, sub, inr/dcr
• Logical operation
– and, or, xor, rotate, compare, complement
• Branch operation
– Jump, call, return
• Data transfer/Copy/Memory operation/IO
– MOV, MVI, LD, ST, OUT
Copy/Mem/IO operation
• MVI R, 8 bit // load immediate data
• MOV R1, R2 // Example MOV B, A
• MOV R M // Copy to R from 0(HL Reg) Mem
• MOV M R // Copy from R to 0(HL Reg) Mem
• LDA 16 bit // load A from 0(16bit)
• STA 16 bit // Store A to 0(16bit)
• LDAX Rp // load A from 0(Rp), Rp=RegPair
• STAX Rp // Store A to 0(Rp)
• LXI Rp 16bit // load immediate to Rp
• IN 8bit // Accept data to A from port 0(8bit)
• OUT 8 bit // Send data of A to port 0(8bit)
Arithmetic Operation
• ADD R // Add A = A + B.reg
• ADI 8bit // Add A= A + 8bit
• ADD M // Add A=A + 0(HL)
• SUB R // Sub A = A -B.reg
• SUI 8bit // Sub A= A - 8bit
• SUB M // Sub A=A - 0(HL)
• INR R // R = R+1
• INR M // 0(HL)=0(HL)+1
• DCR R // R = R-1
• DCR M // 0(HL)=0(HL)-1
• INX Rp // Rp=Rp+1
• DCX Rp // Rp=Rp-1
Other Operations
• Logic operations
– ANA R ANI 8bit ANA M
– ORA, ORI, XRA, XRI
– CMP R // compare with R with ACC
– CPI 8bit // compare 8 bit with ACC
• Branch operations
– JMP 16bit, CALL 16 bit
– JZ 16bit, JNZ 16bit, JC 16bit, JNC 16 bit
– RET
• Machine Control operations
– HLT, NOP, POP, PUSH
Assumption
• RAM Memory is interfaced
• Instructions are stored in memory
• One I/O display port is interfaced to display
data of ACC
Simple Assembly Program
MVI A, 24H // load Reg ACC with 24H
MVI B , 56H // load Reg B with 56H
ADD B // ACC= ACC+B
OUT 01H // Display ACC contents on port 01H
HALT // End the program
Result: 7A (All are in Hex)
DAA operation for Decimal Adjust A+6=10H
Flowchart to multiply two number
Start
LDA 2000 // Load multiplicant to accumulator
MOV B,A // Move multiplicant from A(acc) to B register
LDA 2001 // Load multiplier to accumulator
MOV C,A // Move multiplier from A to C
MOV C,A // Move multiplier from A to C
MVI A,00 // Load immediate value 00 to ACC
ADD B // Add B(multiplier) with A
DCR C // Decrement C, it act as a counter
JNZ L // Jump to L if C!=0
STA 2010 // Store result in to memory
HLT // End
Code to multiply two number
LDA 2000 // Load multiplicant to accumulator
MOV B,A // Move multiplicant from A(acc) to B register
LDA 2001 // Load multiplier to accumulator
MOV C,A // Move multiplier from A to C
MVI A,00 // Load immediate value 00 to a
L: ADD B // Add B(multiplier) with A
DCR C // Decrement C, it act as a counter
JNZ L // Jump to L if C reaches 0
STA 2010 // Store result in to memory
HLT // End
Factorial of a Program
LXI SP, 27FFH ; Initialize stack pointer
LDA 2200H ; Get the number
CPI 02H ; Check if number is greater than 1
JC LAST
MVI D, 00H ; Load number as a result
MOV E, A
DCR A
MOV C,A ; Load counter one less than number
CALL FACTO ; Call subroutine FACTO
XCHG ; Get the result in HL // HL with DE
SHLD 2201H ; Store result in the memory // store HL at 0(16bit)
JMP END
LAST: LXI H, 000lH ; Store result = 01
END: SHLD 2201H
HLT
Sub Routine for FACTORIAL
FACTO: LXI H, 0000H
MOV B, C ; Load counter
BACK: DAD D // double add ; HL=HL+DE
DCR B
JNZ BACK ; Multiply by successive addition
XCHG ; Store result in DE // HL with DE
DCR C ; Decrement counter
CNZ FACTO ; Call subroutine FACTO
RET ; Return to main program
8085 Simulator & Kit
• 8085 Simulator is available
– Course website
• 8085 Kit is available in HW Lab (CS422)
– First test the program on Simulator and then go
for the HW
– Sometime Kit have Driver, IDE and Assembler

More Related Content

What's hot

What's hot (18)

Lec12
Lec12Lec12
Lec12
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
 
Micro task1
Micro task1Micro task1
Micro task1
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentation
 
Instruction set of 8085 microprocessor
Instruction set of 8085 microprocessorInstruction set of 8085 microprocessor
Instruction set of 8085 microprocessor
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
8085 alp programs
8085 alp programs8085 alp programs
8085 alp programs
 
8085
80858085
8085
 
EE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab ManuelEE2356 Microprocessor and Microcontroller Lab Manuel
EE2356 Microprocessor and Microcontroller Lab Manuel
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
8051d
8051d8051d
8051d
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!Microprocessor and Microcontroller Lab Manual!
Microprocessor and Microcontroller Lab Manual!
 
Microprocessor instructions
Microprocessor instructionsMicroprocessor instructions
Microprocessor instructions
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
 

Viewers also liked

Intel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelIntel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelOmar Alkinani
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 

Viewers also liked (6)

Intel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intelIntel 8080 8085 assembly language programming 1977 intel
Intel 8080 8085 assembly language programming 1977 intel
 
Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programming
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 

Similar to Lec03

MICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSMICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSselvakumar948
 
UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER ravis205084
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Swati Watve-Phadke
 
PPT 8085 microprocessor
PPT 8085 microprocessor PPT 8085 microprocessor
PPT 8085 microprocessor Ardhendupanja
 
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
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).pptKanikaJindal9
 
B sc e5.2 mp unit-1 hard ware
B sc e5.2 mp  unit-1 hard wareB sc e5.2 mp  unit-1 hard ware
B sc e5.2 mp unit-1 hard wareMahiboobAliMulla
 
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptx
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptxMECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptx
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptxCHANDRA KUMAR S
 
20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptxMohanumar S
 
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS Mohanumar S
 
8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptxkarthik R
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessorvenkateshkannat
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
 

Similar to Lec03 (20)

Lec04
Lec04Lec04
Lec04
 
Lec04
Lec04Lec04
Lec04
 
MICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSMICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERS
 
UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
MicroProcessors
MicroProcessors MicroProcessors
MicroProcessors
 
8085-paper-presentation.ppt
8085-paper-presentation.ppt8085-paper-presentation.ppt
8085-paper-presentation.ppt
 
PPT 8085 microprocessor
PPT 8085 microprocessor PPT 8085 microprocessor
PPT 8085 microprocessor
 
8085 micro processor
8085 micro processor8085 micro processor
8085 micro processor
 
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
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecture
 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt
 
B sc e5.2 mp unit-1 hard ware
B sc e5.2 mp  unit-1 hard wareB sc e5.2 mp  unit-1 hard ware
B sc e5.2 mp unit-1 hard ware
 
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptx
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptxMECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptx
MECHATRONICS-UNIT 2-8085 MICROPROCESSOR AND 8051 MICROCONTROLLER .pptx
 
20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx
 
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
 
8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 

More from siddu kadiwal (12)

Chp10 sw constr
Chp10 sw constrChp10 sw constr
Chp10 sw constr
 
Lec14
Lec14Lec14
Lec14
 
Lec13
Lec13Lec13
Lec13
 
Lec11
Lec11Lec11
Lec11
 
Lec10
Lec10Lec10
Lec10
 
Lec09
Lec09Lec09
Lec09
 
Lec08
Lec08Lec08
Lec08
 
Lec07
Lec07Lec07
Lec07
 
Lec06
Lec06Lec06
Lec06
 
Lec05
Lec05Lec05
Lec05
 
Lec02
Lec02Lec02
Lec02
 
Ece iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notesEce iv-fundamentals of hdl [10 ec45]-notes
Ece iv-fundamentals of hdl [10 ec45]-notes
 

Recently uploaded

(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 

Recently uploaded (20)

(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 

Lec03

  • 1. 8085 Architecture & Its Assembly language programming Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati
  • 2. Outline • 8085 Era and Features • 8085 – Block diagram (Data Path) – Bus Structure – Register Structure • Instruction Set of 8085 • Sample program of 8085 • Simulator & Kit for 8085
  • 3. 8085 Microprocessor • 8 Bit CPU • 3-6Mhz • Simpler design: Single Cycle CPU • ISA = Pre x86 design (Semi CISC) • 40 Pin Dual line Package • 16 bit address • 6 registers: B, C, D, E, H,L • Accumulator 8 bit
  • 4. W Z B C D E H L SP PC Inc/Dec. ter Add latch MUX Bus 8 Bit Interrupt Control Serial I/O Control IR I Decode & M/C Encodin g tmp RACC Timing and Control ALU Add Buff Data/Add Buff Flag INTR INTA RST5.5 ReSeT6.5 RST7.5TRAP SID SOD 8085 Microprocessor Architecture
  • 5. The 8085 Bus Structure 8085 MPU A15 A0 D0 D7 Address Bus (16bit) Memory I/P Data Bus (8bit) O/P Control Bus (8bit)
  • 6. 8085 Bus Structure • Address Bus : Consists of 16 address lines: A0 – A15 – Address locations: 0000 (hex) – FFFF (hex) – Can access 64K ( = 216 ) bytes of memory, each byte has 8 bits – Can access 64K  8 bits of memory – Use memory to map I/O, Same instructions to use for accessing I/O devices and memory • Data Bus : Consists of 8 data lines: D0 – D7 – Operates in bidirectional mode – The data bits are sent from the MPU to I/O & vice versa – Data range: 00 (hex) – FF (hex) • Control Bus: – Consists of various lines carrying the control signals such as read / write enable, flag bits
  • 7. 8085 Registers • Registers: – Six general purpose 8-bit registers: B, C, D, E, H,L – Combined as register pairs to perform 16-bit operations: BC, DE, HL – Registers are programmable (load, move, etc.) • Stack Pointer (SP) • Accumulator & Flag Register – (Zero, Sign, Carry, Parity, AuxCarry) • Program Counter (PC) – Contains the memory address (16 bits) of the instruction that will be executed in the next step. B C D E H L SP PC
  • 8. How instruction executed • All instructions (of a program) are stored in memory. • To run a program, the individual instructions must be read from the memory in sequence, and executed. – Program counter puts the 16-bit memory address of the instruction on the address bus – Control unit sends the Memory Read Enable signal to access the memory – The 8-bit instruction stored in memory is placed on the data bus and transferred to the instruction decoder – Instruction is decoded and executed
  • 9. Instruction Set of 8085 • Arithmetic Operations – add, sub, inr/dcr • Logical operation – and, or, xor, rotate, compare, complement • Branch operation – Jump, call, return • Data transfer/Copy/Memory operation/IO – MOV, MVI, LD, ST, OUT
  • 10. Copy/Mem/IO operation • MVI R, 8 bit // load immediate data • MOV R1, R2 // Example MOV B, A • MOV R M // Copy to R from 0(HL Reg) Mem • MOV M R // Copy from R to 0(HL Reg) Mem • LDA 16 bit // load A from 0(16bit) • STA 16 bit // Store A to 0(16bit) • LDAX Rp // load A from 0(Rp), Rp=RegPair • STAX Rp // Store A to 0(Rp) • LXI Rp 16bit // load immediate to Rp • IN 8bit // Accept data to A from port 0(8bit) • OUT 8 bit // Send data of A to port 0(8bit)
  • 11. Arithmetic Operation • ADD R // Add A = A + B.reg • ADI 8bit // Add A= A + 8bit • ADD M // Add A=A + 0(HL) • SUB R // Sub A = A -B.reg • SUI 8bit // Sub A= A - 8bit • SUB M // Sub A=A - 0(HL) • INR R // R = R+1 • INR M // 0(HL)=0(HL)+1 • DCR R // R = R-1 • DCR M // 0(HL)=0(HL)-1 • INX Rp // Rp=Rp+1 • DCX Rp // Rp=Rp-1
  • 12. Other Operations • Logic operations – ANA R ANI 8bit ANA M – ORA, ORI, XRA, XRI – CMP R // compare with R with ACC – CPI 8bit // compare 8 bit with ACC • Branch operations – JMP 16bit, CALL 16 bit – JZ 16bit, JNZ 16bit, JC 16bit, JNC 16 bit – RET • Machine Control operations – HLT, NOP, POP, PUSH
  • 13. Assumption • RAM Memory is interfaced • Instructions are stored in memory • One I/O display port is interfaced to display data of ACC
  • 14. Simple Assembly Program MVI A, 24H // load Reg ACC with 24H MVI B , 56H // load Reg B with 56H ADD B // ACC= ACC+B OUT 01H // Display ACC contents on port 01H HALT // End the program Result: 7A (All are in Hex) DAA operation for Decimal Adjust A+6=10H
  • 15. Flowchart to multiply two number Start LDA 2000 // Load multiplicant to accumulator MOV B,A // Move multiplicant from A(acc) to B register LDA 2001 // Load multiplier to accumulator MOV C,A // Move multiplier from A to C MOV C,A // Move multiplier from A to C MVI A,00 // Load immediate value 00 to ACC ADD B // Add B(multiplier) with A DCR C // Decrement C, it act as a counter JNZ L // Jump to L if C!=0 STA 2010 // Store result in to memory HLT // End
  • 16. Code to multiply two number LDA 2000 // Load multiplicant to accumulator MOV B,A // Move multiplicant from A(acc) to B register LDA 2001 // Load multiplier to accumulator MOV C,A // Move multiplier from A to C MVI A,00 // Load immediate value 00 to a L: ADD B // Add B(multiplier) with A DCR C // Decrement C, it act as a counter JNZ L // Jump to L if C reaches 0 STA 2010 // Store result in to memory HLT // End
  • 17. Factorial of a Program LXI SP, 27FFH ; Initialize stack pointer LDA 2200H ; Get the number CPI 02H ; Check if number is greater than 1 JC LAST MVI D, 00H ; Load number as a result MOV E, A DCR A MOV C,A ; Load counter one less than number CALL FACTO ; Call subroutine FACTO XCHG ; Get the result in HL // HL with DE SHLD 2201H ; Store result in the memory // store HL at 0(16bit) JMP END LAST: LXI H, 000lH ; Store result = 01 END: SHLD 2201H HLT
  • 18. Sub Routine for FACTORIAL FACTO: LXI H, 0000H MOV B, C ; Load counter BACK: DAD D // double add ; HL=HL+DE DCR B JNZ BACK ; Multiply by successive addition XCHG ; Store result in DE // HL with DE DCR C ; Decrement counter CNZ FACTO ; Call subroutine FACTO RET ; Return to main program
  • 19. 8085 Simulator & Kit • 8085 Simulator is available – Course website • 8085 Kit is available in HW Lab (CS422) – First test the program on Simulator and then go for the HW – Sometime Kit have Driver, IDE and Assembler