Its Assembly language programming

Similar documents
CS521 CSE IITG 11/23/2012

8085 INSTRUCTION SET INSTRUCTION DETAILS

INSTRUCTION SET OF 8085


Assembly Language Programming of 8085

(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

Assembly Language Programming of 8085

Introduction to Assembly Language Programming (Instruction Set) 1/18/2011 1

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

ELECTRICAL ENGINEERING

SAMPLE STUDY MATERIAL

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

LIST OF PROGRAMS. Prg. Name of the Program. 1 Study of Pin Diagram of Study of Architecture of Study of 8085 Kit.

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

UNIT I. Differences between: Microcomputer, Microprocessor and Microcontroller

م.م. ماجد عيدان. Introduction to microprocessor and microcomputer

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

Unit 1 8 BIT MICROPROCESSOR ARCHITECTURE

Practical Course File For

Subject Code: Model Answer Page No: /25

The 8085 Instruction Set

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

GATE Exercises on Microprocessors

EXAMPLE PROGRAMS 8085

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Assembly language Programming

LABORATORY MANUAL. PROGRAMME: B.Tech SEMESTER /YEAR: 3rd year 5th Semester SUBJECT CODE: CS592 SUBJECT NAME: Microprocessor & Microcontroller Lab

EE309: Computer Organization, Architecture and MicroProcessors. sumantra/courses/up/up.html GND HIGH ORDER ADDRESS BUS

The due date for submitting this assignment has passed. 1) How many times will the following loop be executed? Depends on the initial value of A

8085 Microprocessor Programs

Matrix Multiplication in 8085

Q. P. Code : b. Draw and explain the block dig of a computer with microprocessor as CPU.

G. Pullaiah College of Engineering and Technology: Kurnool Department Of Electronics and Communication Engineering

EKT222 Miroprocessor Systems Lab 5

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

ROEVER ENGINEERING COLLEGE

SIR.C.R.R.COLLEGE OF ENGINEERING DEPT. OF ELECTRONICS AND INSTRUMENTATION ENGG. EIE-328: MICROPROCESSOR LABORATORY 3/4 B.E. EIE: SECOND SEMESTER

COPYRIGHT IS NOT RESERVED BY AUTHORS. AUTHORS ARE NOT RESPONSIBLE FOR ANY LEGAL ISSUES ARISING OUT OF ANY COPYRIGHT DEMANDS

1. What is Microprocessor? Give the power supply & clock frequency of 8085?

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Computer Organization

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

S.R.M. INSTITUTE OF SCIENCE & TECHNOLOGY SCHOOL OF ELECTRONICS & COMMUNICATION ENGINEERING

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL ELECTRONICS & MICROPROCESSOR LAB MANUAL 2/4 CSE: II- SEMESTER

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

History and Basic Processor Architecture

MICROPROCESSOR BASICS AND RELATED TERMS

INDEX. 1 Study of intel 8085 micropeocessor kit. 2 Program to find addition of two 8 bit no. 3 Program to find subtraction of two 8 bit no.

XII HSC - BOARD - MARCH

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

ADD R Operation : ACC = ACC + R SIZE : 1 byte, 8 bit Time : 3 T Cycle Work : Read R, Read ACC, Add, Write Result to ACC

Microprocessor Micro Syllabus BSc. CSIT, IOST, TU. Microprocessor

Instruction set of 8085

Programming of 8085 microprocessor and 8051 micro controller Study material

Counters & Time Delays. Microprocessors & Interfacing 1

1 = Enable SOD 0 = Disable SOD. Serial Output Data. Fig.12.9 SIM Instruction Format

The functional block diagram of 8085A is shown in fig.4.1.

1. Internal Architecture of 8085 Microprocessor

(2½ Hours) [Total Marks: 75]

Micro Processor & Micro Controllers

PERIPHERAL INTERFACING Rev. 1.0

MICROPROCESSOR AND MICROCONTROLLER

DE60/DC68 MICROPROCESSORS & MICROCONTROLLERS JUN 2015

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

1. Internal Architecture of 8085 Microprocessor

CS2259-MICROPROCESSOR AND MICROCONTROLLER LABORATORY MANUAL

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M. 2 PUSH/ POP R16/M16/SR/F 2 x ( ) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M

1. What is microprocessor? It is a program controlled semi conductor device (IC), which fetches, decodes and execute instructions.

8085 Microprocessor Architecture and Memory Interfacing. Microprocessor and Microcontroller Interfacing

Valliammai Engineering College

AE66/AC66/AT66/ AE108/AC108/AT108 MICROPROCESSORS & MICROCONTROLLERS

LABORATORY 1 INTRODUCTION TO 8085 MICROPROCESSOR DEVELOPMENT SYSTEM BOARD

Microprocessor Architecture

PERIPHERAL INTERFACING Rev. 1.0

MGM S Jawaharlal Nehru Engineering College


The advantages of registers over memory locations are as follows:

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

Instruction : A command to the microprocessor to perform a given task on specified data. Each instruction has two parts

EECE 340 Introduction to Microprocessors w/lab Section A. Term Project Parking Visitor Counter

ET2640 Microprocessors

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

B.C.A 2017 MICROPROCESSOR AND ASSEMBLY LANGUAGE MODULE SPECIFICATION SHEET. Course Outline

UNIT 18 PROGRAMMING MICROPROCESSORS

Chapter 1: Basics of Microprocessor [08 M]

Microcomputer Architecture and Programming

Pin Description, Status & Control Signals of 8085 Microprocessor


Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

8/26/2010. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to Three Units of 8085

1. Internal Architecture of 8085 Microprocessor

MACHINE CONTROL INSTRUCTIONS: 1. EI

12-Dec-11. Gursharan Singh Maninder Kaur. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to 8085

Transcription:

8085 Architecture & Its Assembly language programming Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati

8085 Era and Features 8085 Outline Block diagram (Data Path) Bus Structure Register Structure Instruction Set of 8085 Sample program of 8085 Simulator & Kit for 8085

8 Bit CPU 8085 Microprocessor 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

8085 Microprocessor Architecture ReSeT6.5 INTR INTA RST5.5 RST7.5 TRAP SID SOD Interrupt Control Serial I/O Control Bus 8 Bit ACC tmp R IR W MUX Z Flag ALU I Decode & M/C Encodin g B C D E H L SP PC Inc/Dec. ter Add latch Timing and Control Add Buff Data/Add Buff

The 8085 Bus Structure A 15 A 0 Address Bus (16bit) 8085 MPU Memory I/P O/P D7 D0 Data Bus (8bit) Control Bus (8bit)

8085 Bus Structure Address Bus : Consists of 16 address lines: A 0 A 15 Address locations: 0000 (hex) FFFF (hex) ( ) y y, y Can access 64K ( = 2 16 ) 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: D 0 D 7 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 thecontrol 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 D H SP PC C E L

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. Programcounter puts the 16 bitmemoryaddress 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 // A td t t A f t 0(8bit) 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

Logic operations Other 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 BA B,A // Move multiplicant li li from A(acc) to B register LDA 2001 // Load multiplier to accumulator MOV CA 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: BACK: LXI H, 0000H MOV B, C ; Load counter 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 ; Cll 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