Page 16 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 16

List of Figures                                                      xv


         Figure 3.1  Op Code Byte Coding                                      60
         Figure 3.2 Post Byte Coding                                          62
         Figure 3.3 Program segment to Add Two Bytes Using Vector Indexing    63
         Figure 3.4  Offset Calculation                                       63
         Figure 3.5 Autoincrement Address Calculation                         64
         Figure 3.6 Program segment to Add Two Bytes Using Autoincrementing   65
         Figure 3.7 Accumulator Index Address Calculation                     66
         Figure 3.8 Simplified Control Hardware for Relative Addressing       68
         Figure 3.9 Program Segment Using BRA, Illustrating Position Independence  69
         Figure 3.10 Program Segment to Put a Square Wave on an Output Port   69
         Figure 3.11 A Stack Buffer for Two Stacks                            72
         Figure 3.12 Subroutine to Compute n! Recursively                     73
         Figure 3.13 Subroutine to Compute n! in a Loop                       73
         Figure 3.14 Nonreentrant Subroutine to Delay                         74
         Figure 3.15 Reentrant Subroutine to Ckear Memory                     74
         Figure 3.16 A Stack Buffer for Nested Segments                       75
         Figure 3.17 Program Segment to Clear a Block of Memory               76
         Figure 3.18 Program Segment to Move a Block of Memory                77
         Figure 3.19 Program Segment to Add Vector Elements                   77
         Figure 3.20 Program Segment to Compute an Inner Product              78
         Figure 3.21 A Table                                                  85

         Figure 4.1 Program MAX                                               89
         Figure 4.2 Assembler Source Code for the Program MAX                 90
         Figure 4.3  Assembler Listing for the Program MAX                    92
         Figure 4.4  Assembler Listing for the Program Square                 96
         Figure 4.5  Program to Select Negative Odd Numbers                   97
         Figure 4.6  Program with Illegal Forward Reference                   98
         Figure 4.7 Program without Forward Reference                         99
         Figure 4.8 Print Program                                            100
         Figure 4.9 Character Move Program Segment and Data                  101
         Figure 4.10 Character String Compare Program Segment and Data       101
         Figure 4.11 Character Search in a String                            102
         Figure 4.12 Directory Program Segments                              102
         Figure 4.13 Machine and Source Code                                 103
         Figure 4.14 Simple Computer and Assembler SA1 Specifications        103
         Figure 4.15 Assembler Main Program                                  104
         Figure 4.16 Assembler Directives                                    104
         Figure 4.17 Assembler Pass 1                                        104
         Figure 4.18 Assembler Pass 2                                        105
         Figure 4.19 Subroutine to Get the Opcode                            106
         Figure 4.20 Subroutine to Insert a Label as an Operand              106
         Figure 4.21 Convert ASCII Hex String to a Binary Number             107
         Figure 4,22 Program with Relative Address Reference                 110
         Figure 4.23 Program with Direct or Page Zero Reference              110
         Figure 4.24 Program with Errors                                     112
         Figure 4.25 Another Program with Errors                             113
   11   12   13   14   15   16   17   18   19   20   21