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

1,3 A Few Instructions And Some Simple Programs                       9










        Notice that the "#" is missing in this mnemonic because we are using direct addressing
        instead of immediate addressing. Also, the second two bytes of the instruction give the
        address of the operand, high byte of the address first.
            The store instruction is like the load instruction described earlier except that it works
        in the reverse manner (and a STAA or STAB with the immediate addressing mode is
        neither sensible nor available). It moves a word from a register in the MPU to a memory
        location specified by the effective address. The mnemonic, for store from A, is STAA;
        the instruction

                                      STAA 2090

        will store the byte in A into location 2090 (decimal). Its machine code is












        where we note that the number 2090 is stored in hexadecimal as $082A. With direct
        addressing, two bytes are always used to specify the address even though the first byte
        may be zero.






















                              Figure 13. Registers and Memory
   27   28   29   30   31   32   33   34   35   36   37