Programming with GCC for CP/M-68K |
Creating
CP/M-68K transient utility programs |
|
A CP/M-68K command
line consists of a command keyword, an optional command
tail, and a RETURN keystroke. A command keyword
identifies a program that resides either in memory as
part of CP/M-68K, or on a disk as a program file.
Commands that identify program files on a disk are
called transient utility commands and the programs that
those commands invoke are called transient utility
programs. |
|
To successfully
build example1 and example2 (below) the GNU Compiler
Collection (GCC) must be preinstalled. Installation of
the the GNU Make
utility is optional as alternative script files are
provided, however it is highly recommended that you
install both - future example programs will require GNU
Make. |
|
GCC installation
instructions can be found here: |
Software/GCC |
|
GNU Make installation
instructions can be found here: |
Software/Make |
|
Getting
started |
|
Follow the instructions below to create a very simple
transient utility program that can be downloaded to a
Mega-680x0 Computer System and run from a CP/M-68K
command prompt.
The source code can be used as a GCC template for
writing more complex CP/M-68K programs that will run on
any CP/M-68K capable Mega-680x0 Computer System.
The example presented here simply displays "12340000"
shortly followed by "00005678" on the Hex Display Board. |
|
1. |
Download the following ZIP file: |
|
gcc_cpm-example1 |
2. |
Extract the contents of the ZIP file to a
new folder |
|
Remember the name and location of the folder, |
|
this
will be referred to as the project folder |
|
Tip: it is
convenient to keep the path to the project
folder short, |
|
here
we will use c:\gcc |
3. |
Check
the contents of the project folder - there should
be 4
files: |
|
example1.s |
GCC
Source File |
makefile |
GNU Make File |
build-cpm.sh |
Script File |
clean-cpm.sh |
Script
File |
|
4. |
Sign in to
Linux |
5. |
Type: cd /mnt/c/gcc |
6. |
Type: ls |
|
Linux OS
will list the 4 files - confirm before
continuing |
7. |
Option1 -
Type: make |
|
Option2 -
Type:
'dot'+'slash'+'build-cpm.sh' i.e. ./build-cpm.sh |
|
In the
Windows project folder there will now be a an
example1.68k file |
8. |
Start the
Mega-680x0 Computer System |
9. |
At the
SYS> prompt type: OS |
10. |
At the
A> prompt type: C: |
11. |
At the
C> prompt type: B:GKERMIT -G EXAMPLE1.68K |
|
The
Mega-680x0 receives, processes, and stores the binary file on disk
C |
|
when
reception is complete, the Mega-680x0 will
accept the
next command |
12. |
At the
C> prompt type: EXAMPLE1 to run the program |
|
|
Another
GCC coding example |
|
Hex Display
Board functional test - cycles through 0-F on each digit in turn. |
Download the
ZIP file:
gcc_cpm-example2 |
|
Script
Files |
|
Each GCC example ZIP file contains two Linux Script Files.
These scripts are a quick and dirty first attempt at making the
command line driven GNU Compiler
Collection (GCC) no more difficult to use than the
simple Windows based EASy68K
IDE (Integrated Development Environment). |
|
./build-cpm.sh |
This script requires no input from the user whatsoever
while invoking the GCC Compiler/Assembler, Linker, and
Object Copy tool to generate a Mega-680x0 CP/M-68K
compatible executable file plus a Motorola S-Record
formatted Mega-680x0 compatible binary file
for good measure. |
Tip: If you have GNU
Make installed it is easier to type: make |
|
./clean-cpm.sh |
This script
deletes all files generated by the build.sh script or
'make' command. |
Tip: If you have GNU
Make installed it is easier to type: make clean |
|
IMPORTANT |
The V1.0 Script Files
are unique to each example, therefore you cannot use
the Script Files from example1 with example2 or
vice-versa. |
|
|