Introduction
============

This archive contains a simple program, written in the C language, for the 
Amstrad CPC computer.

This program has been compiled using the SDCC v2.4.1 suite (compiler, 
assembler and linker) and GNU make. 

It has been compiled under SuSE Linux 8.2, and tested on the Arnold 
emulator.

Kevin Thacker, Aug 2004

The files
=========

The archive contains the following files:

addhead			
-------

An executable which will add an AMSDOS header to a raw binary file.

cpcxfs
------

An executable which is used to edit disk images. You can use this to 
create new disk images, add and remove files from the image.

crt0.s
------

Z80 Assembler source of startup code for use with AMSDOS. Written by 
H.Hansen.

crt0_basstub.s
--------------

Z80 Assembler source of startup code for use with AMSDOS, contains a 
small BASIC program to execute the program code.

main.c, other.c
---------------

The two source files written in the C language.

main.lnk
--------

A linker script for use with link-z80, uses crt0.s as the startup code.

main2.lnk
--------

A linker script for use with link-z80, uses crt0_basstub.s as the 
startup code.

makefile,makefile2,makefile3
----------------------------

Makefiles used to build the program. See comments below.

putchar.s
---------

Z80 Assembler source containing putchar function required by SDCC standard 
library functions. Written by H. Hansen.

makebin
-------

Modified for use with making files for the CPC.

The makefiles
=============			

There are three makefiles which are invoked using:

make -f <makefile name>

e.g.

make -f makefile2

Every makefile generates a binary executable file, this is processed to 
add an AMSDOS header, and is then injected into a disk image to use on an 
emulator.

The makefiles are:

makefile	
--------

This makefile shows how to use SDCC to compile and 
assemble the object files, these are then linked to make a executable 
file.

makefile2
---------

This makefile shows how to use SDCC to compile the source file into an 
assembler file, as-z80 then assembles these to make object files, and 
finally these are linked to make the executable file.

makefile3
---------

This makefile shows the same build method as makefile2, but the resulting 
executable file contains a small BASIC program at the beginning. This 
program 'stub' executes the main binary program. 




