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

52                                            Chapter 2 The Instruction Set


         arithmetic type of instruction. For example, suppose that one wants to look at the
         contents of some memory location, say $811, and branch to location L if the contents of
         location 458, treated as a signed number, are greater than 0, The sequence
                                      TST     $811
                                      BGT    L

         does exactly this. If the TST instruction had left V unaffected, we would have had to use
         the longer sequence:
                                      LDAA     $ 811
                                      CMPA     #0
                                      BGT     L

         A little more experience will show that the designer's choice here is quite reasonable,
         because we will find a more frequent use of signed branches for load instructions than for
         checking for signed overflow, as we will do in the next chapter.




                        Do You Know These Terms?

        See the end of Chapter I for instructions.

         stack             subroutine       hardware interrupt service routine
         push              jump to          I/O interrupt    latency time
         pull                subroutine     interrupt        interrupt inhibit
         hardware stack    return address   handling         interrupt mask
         buffer            branch to        interrupt handler  stop disable
         post byte           subroutine     device handler   machine state
         hidden register   return from      interrupt service  return from
         prefix byte         subroutine       routine         interrupt
   70   71   72   73   74   75   76   77   78   79   80