Menu

Tree [abc86b] default tip /
 History

Read Only access


File Date Author Commit
 src 2017-11-20 Jay Cotton Jay Cotton [b438f4] first code push
 README 2017-11-20 Jay Cotton Jay Cotton [abc86b] update project readme

Read Me

This is the first push of code for the z80 clock project.

The code has an interesting bit of interrupt hacking that others may
find usefull in future projects.

In ctclib.c is a chunk of code in ctc_init.  Please note that with
BDS C there are a number of awkword deviations from c66 standard.
1.  Can't automatic init an array.
2.  Subroutine nameing is limited to lower case and 8 characters.
3.  It will only compile int and char.

So ctc_init inits an array with byte codes from the bdsint.lst file.
These bytes are the interrupt service routine for the ctc and the acia
chip on the rc2014.

CPM does not have a generalized mechanism for dealing with interrupts.

When running CPM you are stuck with mode 1 interrupts and you must intervine
to get control of interrupts at all.  That is what I am doing with my 
service code.  I grab all the interrupts (sio and ctc) decode what device is
interrupting and handle that.  You will note that if the sio chip was the
interrupt source I jump back to the sio driver in CPM and let it handle the
sio byte.

As you can imagine, there are lots of ways this can fail.  So this code is
sensitive to the system.  Any changes in the sio driver will cause bad 
results for the ctc interrupt handler.  

The clock code is really simple, just wait for a ctc interrupt to happen
(once per second) and run a display update with the new time.  I am using
my lcdlib code for the lcd display.  And my lcd display project, as well.

Also present in this project is snaplib.c and snap.c.

Snaplib.c lets you print out a block of binary or text.  This can be useful
for debugging your program and figuring out if its doing what you intended.
Snap.c is a transiant program that lets you display memory from an address
to the console.  This is really useful for tracking down whats happening in
memory.  Note that CPM does not clear ram on reboot, so most of the code
and data you are trying to debug is still in there.