180x Filetype PDF File size 2.78 MB Source: ndl.ethernet.edu.et
AMBO University Woliso Campus School of Technology & Informatics Department Of Computer Science Microprocessor and Assembly Language Programming Module Code CoSc M2041 Course Code CoSc 2043 Prepared By: Mr. Abdisa Lechisa(MSc) Ambo University Woliso Campus, Woliso, Ethiopia 2012 Microprocessor and Assembly Language Programming Table of Contents CHAPTER 1- INTRODUCTION TO MICROPROCESSOR AND COMPUTER .................................................................... 1 Microprocessor & Its Architecture ......................................................................................................... 4 Addressing Modes .................................................................................................................................. 6 Data movement instructions ................................................................................................................... 9 Arithmetic and Logical Instructions ..................................................................................................... 11 Program control instructions ................................................................................................................. 15 Summary ............................................................................................................................................... 21 CHAPTER 2: PROGRAMMING THE MICROPROCESSOR ................................................................................................ 22 Programming the micro-processor ........................................................................................................ 22 8086/8088 Hardware Specification....................................................................................................... 24 The arithmetic co-processor .................................................................................................................. 29 Memory Interface.................................................................................................................................. 31 Memory organization in 8086 ............................................................................................................... 31 Basic I/O Interface ................................................................................................................................ 34 Comparison of 8086 and 8088 Microprocessor .................................................................................... 36 The 8087-Intel co-processor ................................................................................................................. 36 Bus Interfaces........................................................................................................................................ 39 Summary ............................................................................................................................................... 42 CHAPTER 3: COMPUTER ORGANIZATION ....................................................................................................................... 43 Comparison of 8086 with 8085............................................................................................................. 47 Comparison of 8086 with 8088............................................................................................................. 48 Interrupts in 8086 .................................................................................................................................. 48 Registers for 8086 ................................................................................................................................. 53 Summary ............................................................................................................................................... 56 CHAPTER-4: ASSEMBLY LANGUAGES ............................................................................................................................. 57 Machine Language ................................................................................................................................ 57 Assembly language ............................................................................................................................... 57 i Microprocessor and Assembly Language Programming Instruction operands .............................................................................................................................. 61 Basic Instructions .................................................................................................................................. 67 Assembly Directive ............................................................................................................................... 71 Summary ............................................................................................................................................... 77 CHAPTER-5- WRITING ASSEMBLY LANGUAGE PROGRAMS ...................................................................................... 78 Control Structures ................................................................................................................................. 79 Comparisons ......................................................................................................................................... 79 Branch instructions ............................................................................................................................... 79 The loop instructions............................................................................................................................. 83 Translating Standard Control Structures ............................................................................................... 83 While loops ....................................................................................................................................... 84 Do while loops .................................................................................................................................. 84 CHAPTER-6- PROCEDURES AND FUNCTIONS ................................................................................................................. 86 Procedures ............................................................................................................................................. 86 Near and Far Procedures ................................................................................................................... 90 Nested Procedures ............................................................................................................................. 90 Functions ............................................................................................................................................... 91 Saving the state of Machine .................................................................................................................. 92 Parameters ............................................................................................................................................. 95 Pass by Value .................................................................................................................................... 96 Pass by Reference ............................................................................................................................. 96 Pass by Value-Returned .................................................................................................................... 97 Pass by Result ................................................................................................................................... 97 Pass by Name .................................................................................................................................... 98 Passing Parameters in Registers...................................................................................................... 100 Passing Parameters on the Stack ..................................................................................................... 104 Summary ............................................................................................................................................. 106 CHAPTER-7 INSTRUCTION TYPES ................................................................................................................................... 107 ii Microprocessor and Assembly Language Programming Stack Instructions ................................................................................................................................ 107 PUSH .............................................................................................................................................. 107 POP ................................................................................................................................................. 109 Integral ALU instructions ................................................................................................................... 111 Arithmetic Instructions ................................................................................................................... 111 Logical Instruction .......................................................................................................................... 123 Floating Point instructions .................................................................................................................. 129 iii
no reviews yet
Please Login to review.