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

388                                 Appendix 2 Using the HIWARE CD-ROM


        step by clicking on the RUN menu and releasing on the Single Step item, or by using
        the Fil key, or by clicking on the single step icon, which is a U-shape with an arrow
        into the center of the U. Observe the changes in the registers as the program is executed.
        Note that by right-clicking on the Register window, you can change the register's format
        to binary or decimal representation. Use the format most suitable for the example.
            To examine a part of memory, right-click on the Memory window, and select the
         Address... item. When the dialog box appears, type the address such as hexadecimal 800.
        and then type Enter. Alternatively, to display the memory around the address that is in a
        register such as the stack pointer, drag and drop from the register's box to the Memory
        window. The Memory window should now display the memory beginning with the
        address. The left part of the Memory window displays the memory data, and the right
        part displays the same data as ASCII characters (See Chapter 4). Note that by right-
        clicking on the Memory window, you can change the memory data format to binary or
        decimal representation, or change the memory display's word size to 16 bits or 32 bits.
            You can change the data in memory after the program has been loaded to learn more
        about the topic covered by the example. Double-click on the display of a byte you wish
        to change in the memory window, and retype its hexadecimal value. After entering a
         hexadecimal number into the memory, press Enter or press another number key to enter
        a number into the next memory location. You can also double-click on the ASCII
        representation of the memory data to enter ASCII characters into memory.
            You can run until an instruction is executed. Right-click on the Assembly window
        on the line displaying the instruction at which you wish to stop. Release on the Run To
        Cursor item. You can set breakpoints, which are instructions which you wish to stop at,
        and run the program to the first breakpoint it meets. Right-click on the Assembly
        window on the line displaying the instruction at which you set a breakpoint and release
        on the Set Breakpoint item. Then start execution by clicking on the RUN menu and
        releasing on the Start/Continue item, or by using the F5 key, or by clicking on the
        Start/Continue icon, which is a green arrow.
            Finally, you can insert the instruction BRA *, whose opcode is $20FE, at the end
        of your program. Start the program as described above. After a moment, stop it by
        clicking on the Stop icon, which is a red tee.
            To write a new program into memory, load the file blank.abs. This file merely has a
         value of zero written into location 800. Then type the program machine code into the
        Memory window. Note that you cannot type a program into the Assembly window. But
        after a program is manually entered into the Memory window, you can see the program
        in the Assembly window to verify that you got the correct machine code into memory,
        A2.4 Running Examples From the AssemblyProgramFolder


        Assembly ProgramFolder has files such as Ea4.txt, which contain examples from chapter
        4 in this text book, and which you can copy and paste into an assembler source file such
        as Program.asm. To assemble Program.asm to generate an absolute file such as
        Program .abs, open the assembler by clicking on the assembler icon in the HIWARE
   406   407   408   409   410   411   412   413   414   415   416