
This is a collection of examples of 68HC11/68HC12 programs in C, assembly
to show how to use the GNU development chain. 

config		Configuration files to build everything.
lib		General purpose library used by the examples
simple		Simple hello bootstrap program
trap		Simple trap example
timer           Timer example (68HC11 only; not yet ported to 68HC12)
calculator	Calculator example (16, 32 or 64 bit)
benchs		Benchmark programs (basic types, misc, floats)
gtam		Several boot programs for gtam
primes		Prime Numbers computation
analyzer	Simple logical analyzer

The examples can be built for the following boards:

m68hc11-cme11		Axiom Manufacturing CME11 EVBU
			(32K ram with Buffalo)

m68hc11-32k		Generic board with 32K ram, 32K rom

m68hc11-ebcs		SCz board, 8K ram

m68hc12-axcmd12		Axiom Manufacturing CMD12 board
			(32K ram with Dbug monitor)

The board is configured either by specifying it to the command line
or by updating the file config/board.def. For the first method,
type the following command:

	make BOARD=m68hc11-cme11

Otherwise, in config/board.def change the line:

	BOARD=

to put the board you selected.

To build everything, make sure the compiler is in your path and just type:

	make
      or
	make BOARD=<board-name>


Note:	For Windows, if you don't have make and sh, you can use the
	'build.bat' autoexec files.  The configuration is defined within
	'config.bat' that you can edit and change according to your board.

This produces several programs and executables:

	*.elf represent the 68HC11 program in ELF format. These file
	contain symbolic debug information. These are the file that
	GDB requires for debugging and executing the program.

	*.s19 represent the same program in S19 format (without debug info).

	*.b represent the program in binary (raw data).

To execute the program, .... you have some choice:

  Simulator:	m6811-elf-run <prog>.elf
	      or
		m6811-elf-run -v <prog>.elf

  Gdb Sim:	m6811-elf-gdb <prog>.elf
		(gdb) target sim
		(gdb) load <prog>.elf
		(gdb) run

  Gdb Buffalo:	m6811-elf-gdb <prog>.elf
  (CME11)	(gdb) set remotebaud 9600
		(gdb) target buffalo /dev/ttyS2
		(gdb) load <prog>.elf
		(gdb) run

  Gdb Dbug:	m6811-elf-gdb <prog>.elf
  (CMD12)	(gdb) set remotebaud 9600
		(gdb) target dbug /dev/ttyS2
		(gdb) load <prog>.elf
		(gdb) run

  Bootstrap:	Upload the program (either <prog>.elf, or <prog>.s19)
		with your favorite target manager.

  Prom:		Burn the <prog>.b in some prom.


Adapting to a new board

   The easiest way to adapt the examples for your board is probably
   to copy the m68hc11-32k directory to another directory and update
   the memory.x and optionally the make.defs file to define the
   characteristics of your board.

   Have also a look at lib/exit.c to see whether the exit() implementation
   works for your board.
