303
hackmykaam.com hackmykaam.com

Understanding 8085/8086 Microprocessors and · PDF file2. Understanding 8085/8086 Microprocessors and Peripheral ICs through Questions and Answers . Examples of mnemonics are: INR

Embed Size (px)

Citation preview

  • hackmykaam.com

    hackmykaam.com

  • hackmykaam.com

    hackmykaam.com

  • This pageintentionally left

    blank

    hackmykaam.com

    hackmykaam.com

  • hackmykaam.com

    hackmykaam.com

  • Copyright 2010, 2006, New Age International (P) Ltd., PublishersPublished by New Age International (P) Ltd., Publishers

    All rights reserved.No part of this ebook may be reproduced in any form, by photostat, microfilm,xerography, or any other means, or incorporated into any information retrievalsystem, electronic or mechanical, without the written permission of the publisher.All inquiries should be emailed to [email protected]

    PUBLISHING FOR ONE WORLD

    NEW AGE INTERNATIONAL (P) LIMITED, PUBLISHERS4835/24, Ansari Road, Daryaganj, New Delhi - 110002Visit us at www.newagepublishers.com

    ISBN (13) : 978-81-224-2974-9

    hackmykaam.com

    hackmykaam.com

  • Preface to the Second Edition

    It is heartening to note that the text is going to the second edition. Inadvertently, numeroustypographical errors crept into the first edition - which are being taken care of in this edition.

    Requests from many faculty as well as students have led the author to include 8086Microprocessor and its peripheral ICs in an elaborate fashion to the existing book.

    The author is open to suggestions for improvements of the book.

    S.K. Sen

    hackmykaam.com

    hackmykaam.com

  • This page intentionally left

    blank

    hackmykaam.com

    hackmykaam.com

  • Preface to the First Edition

    Since the advent of microprocessors in the 70s, a good many books have been written coveringdifferent aspects of microprocessors and microcomputers. A knowledge and exposure tomicroprocessors is a must for practising engineers and scientists in the fields of Electrical,Electronics, Instrumentation and Software Engineering.

    This book, written in a problem-solution form, is primarily intended for undergraduate studentsof Engineering who have already gone through the course on microprocessors, but is at sea infinding out the right answers to the numerous questions that confront them. In my view, this bookis an answer to their long list of queries.

    Amongst the microprocessors available, 8085 has been taken up for discussion because it is atime-tested 8 bit microprocessor and still very much in use today. Smaller bit microprocessorshave not much relevance and larger bit microprocessors are merely an extension of this basicmicroprocessor. Thus, a thorough understanding of 8085 microprocessor is central and is agateway to the more powerful range of microprocessors in use today.

    The book begins with a discussion on microprocessor, microcomputer and associated languagesin Chapter 1 followed by a detailed discussion on 8085 microprocessor in Chapter 2 and instructiontypes and timing diagrams in Chapter 3. Interrupt details of 8085 are taken up for discussion inChapter 4 while programming techniques are discussed in Chapter 5. Chapter 6 discusses stackand subroutines, while data transfer technique and interfacing are taken up for discussion inChapter 7. A detailed discussion on memory is included in Chapter 8. Different peripherals like8255, 8155/8156, 8355/8755, 8279, 8259, 8257, 8253, 8254 and 8251 are discussed in Chapter 9,while the last and concluding Chapter discusses bus standards RS-232C and IEEE-488.

    This comprehensive book on microprocessor and peripheral ICs will cater to the needs ofengineering students, and for students appearing and aspiring for GATE, IETE, AMIE and otherall India level examinations conducted by various public sector undertakings.

    Suggestions for improvements in any form will be highly appreciated by the author.

    S.K. Sen

    hackmykaam.com

    hackmykaam.com

  • This page intentionally left

    blank

    hackmykaam.com

    hackmykaam.com

  • Contents

    Preface to the Second Edition v Preface to the First Edition vii

    1. Microprocessor, Microcomputer and Associated Languages 1-10 2. The 8085 Microprocessor 11-31 3. Instruction Types and Timing Diagrams 32-34 4. 8085 Interrupts 35-45 5. Programming Techniques 46-57 6. Stack and Subroutines 58-66 7. Data Transfer Techniques: Interfacing Memories and I/Os 67-75 8. Memory 76-91 9. Peripheral Chips

    (a) 8255 : Programmable Peripheral Interface 92-103 (b) 8155/8156 : Programmable I/O Ports and Timer 104-108 (c) 8355/8755 : Programmable I/O Ports with ROM/EPROM 109-110 (d) 8279 : Programmable Keyboard/Display Interface 111-116 (e) Priority Interrupt Controller 8259 117-132 (f) Programmable DMA Controller (DMAC) 8257 133-143 (g) Programmable Interval Timer 8253 144-148 (h) 8254 : Programmable Interval Timer 149-152 (i) USART 8251 (Universal Synchronous/Asynchronous Receiver Transmitter) 153-167

    10. Bus Standards (a) RS : 232C Standard 168-169 (b) IEEE : 488 Bus 170-181 (c) The Universal Serial Bus (USB) 182-192

    11. The 8086 Microprocessor 193-209 12. Memory Organisation 210-218 13. Addressing Modes of 8086 219-225 14. The Instruction Set of 8086 226-239 15. Programming Techniques 240-243 16. Modular Program Development and Assembler Directives 244-250

    hackmykaam.com

    hackmykaam.com

  • x Contents

    17. Input/Output Interface of 8086 251-256 18. 8086 Interrupts 257-267 19. (a) 8288 Bus Controller 268-271

    (b) 8087 Numeric Data Processor 272-278 (c) 8089 I/O Processor 279-284 (d) 8289 Bus Arbiter 285-290

    Index 291

    hackmykaam.com

    hackmykaam.com

  • 1 Microprocessor, Microcomputer and Associated Languages

    1. On which model is based the basic architecture of a digital computer? Ans. The basic architecture of a digital computer is based on Von Neumann model.

    2. What is meant by distributed processing? Ans. Distributed processing involves the use of several microprocessors in a single computer

    system. For example, for such a system, the first microprocessor may control keyboard activities, the second controls storage devices like disk drives, the third controls input/ output operations, while the fourth may act as the main system processor.

    3. When was the first microprocessor developed? Ans. The first microprocessor was developed by BUSICOM of Japan and INTEL of USA in the

    year 1971.

    4. What is a microprocessor? Ans. A microprocessor may be thought of as a silicon chip around which a microcomputer is

    built.

    5. What is the technology used in microprocessors? Ans. NMOS technology is used in microprocessors.

    6. What are the three main units of a digital computer? Ans. The three main units of a digital computer are: the central processing unit (CPU), the

    memory unit and the input/output devices.

    7. How does the microprocessor communicate with the memory and input/output devices?

    Ans. The microprocessor communicates with the memory and the Input/Output devices via the three buses, viz., data bus, address bus and control bus.

    8. What are the different jobs that the CPU is expected to do at any given point of time?

    Ans. The CPU may perform a memory read or write operation, an I/O read or write operation or an internal activity.

    9. What is a mnemonic? Ans. It is very difficult to understand a program if it is written in either binary or hex code.

    Thus the manufacturers have devised a symbolic code for each instruction, called a mnemonic.

    hackmykaam.com

    hackmykaam.com

  • 2 Understanding 8085/8086 Microprocessors and Peripheral ICs through Questions and Answers

    Examples of mnemonics are: INR A, ADD M, etc.

    10. What is machine language programming? Ans. Programming a computer by utilising hex or binary code is known as machine language

    programming.

    11. What is meant by assembly language programming? Ans. Programming a microcomputer by writing mnemonics is known as assembly language

    programming.

    12. What are meant by low level and high level languages? Ans. Programming languages that are machine dependent are called low level languages. For

    example, assembly language is a low level language. On the other hand, programming languages that are machine independent are called

    high level languages. Examples are BASIC, FORTRAN, C, ALGOL, COBOL, etc.

    13. What is meant by word length of a computer? Ans. The number of bits that a computer recognises and can process at a time is known as

    its word length.

    14. What is meant by instruction? Ans. An instruction is a command which asks the microprocessor to perform a specific task

    or job.

    15. How many different instructions mmmmmP 8085 has? What is an instruction set? Ans. 8085 microprocessor has a total of 74 different instructions for performing different

    operations or tasks. The entire different instructions that a particular microprocessor can handle is

    called its instruction set.

    16. What an instruction consists of? Ans. An instruction consists of an operation code (called opcode) and the address of the data

    (called operand), on which the opcode operates.

    Operation code (or opcode) Address of data (or operand)

    Field 1 Field 2

    17. Give one example each of the different types of instructions. Ans. Instructions can be of (i) direct (ii) immediate (iii) implicit type. Examples of each

    type follows: (i) direct type : LDA 4000

    (ii) immediate type : MVIA, 1F (iii) implicit type : ADD C

    18. What language a microprocessor understands? Ans. Microprocessor understands only binary language.

    19. How the mnemonics written in assembly language are translated into binary? Ans. The translation from assembly language (i.e., mnemonics) into binary is done eithe