Getting Started with M68K Coral 66: Compilation System for the Motorola M68000 Family | ||
---|---|---|
Prev | Chapter 2. Advanced Techniques | Next |
By default, the executable file is in Common Object File Format (COFF). This is an industry-standard format for relocatable and executable object code. Using the object code utility program m68k-coff-objcopy, COFF files may be converted into other industry-standard formats, such as Intel Hex, and Motorola S Records.
The following example shows how we convert a COFF file to Intel Hex format.
If you don't need the COFF file, then you can get the compiler to generate the Intel Hex file directly.
Example 2-6. Generating Intel Hex
$ m68k-coff-gcc -O2 hello.c -o hello.ihex -oformat=ihex $ more hello.ihex :1400800085F0F7FFE5EE85108000832085008000B101F102CC :14009400750791010000A210A102F1027AFB850080004A023C :1400A80080008550800085600BC08135814093367EF00068A9 :1400BC0085000000851009D77EF000A5E5007EF000857FF0DC ...lots of output... $
We can run the Intel Hex file, as in the following example:
Or we can generate Motorola S Records, and run from there.
Example 2-8. Running an S Record File
$ m68k-coff-gcc -O2 hello.c -o hello.sre -oformat=srec $ more hello.sre S00C000068656C6C6F2E73726567 S117008085F0F7FFE5EE85108000832085008000B101F102C8 S1170094750791010000A210A102F1027AFB850080004A0238 S11700A880008550800085600BC08135814093367EF00068A5 S11700BC85000000851009D77EF000A5E5007EF000857FF0D8 S11700D0B2F29FEE81EF85200BBA0A01860200007511803E36 ...lots of output... $ m68k-coff-run hello.sre Hello world $