TUTORIAL
This section was written to help you get started developing software with the
The following sections take you through the complete development cycle of a simple "hello world" program, which sends the string "Hello World" to the serial port.
Creating source code
You can write source code for the
You can write your source code using any ASCII text editor. You can use the free EDIT or NOTEPAD programs that come with your computer. Once your source code is written and saved to a file, you can assemble or compile it to a Motorola
It's important to understand your development board's use of Memory and Addressing when writing source code so you can locate your code at valid addresses. For example, when in debug mode, you should put your program CODE in External RAM. In assembly language, you do this with ORG statements in your source code. Any lines following an ORG statement will begin at that ORG location, which is the first number following the word ORG, for example: ORG $1000. You must start your DATA (or variables) in a RAM location unused by your program, for example: ORG $0000.
In “debug mode” you’ll be using a debugger utility (Mon12,NoICE, etc) which will handle both interrupts (reset, timers, etc) and the STACK. When finished debugging, you must add code to your application to handle the STACK and Interrupt vector initialization. Set the stack somewhere at the top of your available RAM, for example $7FE, in assembly this would be LDS #$7FE. Also define the RESET vector address, $FFFE, at the end of your program. For example:
ORG $FFFE
FDB START ; where START is the beginning label of your program
A look at the example programs on the disk can make all of this clearer. If you're using a compiler instead of an assembler, consult the compiler documentation for methods used to locate your code, data and stack.
5