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

123   The 6805                                                      357















































                   Table 123. Instruction Set and Addressing Modes of the 6805

            Figure 12.7 is a 6805 example of the subroutine DOTPRD in Chapter 6 that passes
        parameters as global variables, because the 6805 stack can't effectively pass parameters.
        Also, local variables are not allocated or deallocated, because the stack can't effectively
        hold local variables. Otherwise this subroutine is very similar to the 6808 DOTPRD.
            Returning to the 6808, which is upward compatible to the 6805, the assembly
        language as well as machine code instructions that are in both will execute the same,
        except that the 6808 V condition code is modified as it is in the 6812. If the H register is
        not used, it is initialized to zero, and index addressing is the same in both machines. In
        fact, the H register is not stacked when SWI is executed or when an interrupt occurs. An
        interrupt handler has to save and restore H using an explicit PSHH or PULH instruction.
            We focus here on programming this microcontroller, but we are intrigued by the
        6805 hardware and spellbound by the possibilities of applying it. With this coverage and
        the information in a data sheet for the 6805, you should be able to write short programs
        for that very-low-cost microcomputer.
   375   376   377   378   379   380   381   382   383   384   385