While this may be more of a programming question, it's specific to the TRS-80 so this seems to be the place to ask.
Has anyone here every used Mike Stump's shareware ZC from 1987 for C programming?
Aside from being in disk collections, I can't find any mention of it anywhere: not on comp.sys.tandy, and not here. The only other versions of C for the TRS-80 are Alcor C, which creates p-code (!), and Misosys LC, which requires LDOS.
Anyway, I downloaded it and have been playing with it on an emulator, and I think it's a really interesting system, especially for a shareware one. It consists of zc, the K&R C compiler, zas, a very simple assembler, zlink the linker, and a bunch of /lnk library files.
Some notes:
Most of the instructions are spent explaining what it can't do rather than what it can. But I found that actually it's reasonably complete, and find it easy to write file-based programs that run on any DOS without much problems. A sample program is included, and that program (a RS-232 terminal) is sophisticated enough to show off its capabilities. (And that source is the ONLY clue to some of them.) All the C file redirection of standard i/o seems to work. No direct float support, but there are libraries that use the ROM's.
Mike Stump clearly wrote it on a Model III: not only does it come on a TRSDOS 1.3 disk, but all executables use many Model III-specific RAM addresses like the top-of-memory and the command line. But I was able to make a Model I version by patching all "4411" bytes to "4049" and "4225" to "4318" (in zc/cmd, zas/cmd, zlink/cmd, and stdio/lnk, which is the C runtime.)
The linker is hilarious: whenever it hits an external function, it just asks YOU what the name of the library file is! The whereisz/doc file lists where each function is in which library. Note that some functions are in multiple libraries--you have alternates to choose from. And even then it expects you to PATCH (or SUPERZAP) in the end-of-program address.
But anyway it's a really neat system to make TRS-80 programs with C. For instance, I used ZC to write TRS-80 version of tenox's "aclock" program, which draws a live clock in text mode. I submitted it, and tenox accepted it!
You can find the source here:
https://github.com/tenox7/aclock/blob/master/sources/aclockm1-trs80-model1.c
https://github.com/tenox7/aclock/blob/master/sources/aclockm3-trs80-model3.c
And cmd files here:
https://github.com/tenox7/aclock/blob/master/binaries/z80/aclockm1-trs80-model1.cmd
https://github.com/tenox7/aclock/blob/master/binaries/z80/aclockm3-trs80-model3.cmd
One thing I would love to see would be the original source of the compiler, since it was clearly self-hosted. I wonder if anyone knows Mr. Stump and can ask him?
John D.
Has anyone here every used Mike Stump's shareware ZC from 1987 for C programming?
Aside from being in disk collections, I can't find any mention of it anywhere: not on comp.sys.tandy, and not here. The only other versions of C for the TRS-80 are Alcor C, which creates p-code (!), and Misosys LC, which requires LDOS.
Anyway, I downloaded it and have been playing with it on an emulator, and I think it's a really interesting system, especially for a shareware one. It consists of zc, the K&R C compiler, zas, a very simple assembler, zlink the linker, and a bunch of /lnk library files.
Some notes:
Most of the instructions are spent explaining what it can't do rather than what it can. But I found that actually it's reasonably complete, and find it easy to write file-based programs that run on any DOS without much problems. A sample program is included, and that program (a RS-232 terminal) is sophisticated enough to show off its capabilities. (And that source is the ONLY clue to some of them.) All the C file redirection of standard i/o seems to work. No direct float support, but there are libraries that use the ROM's.
Mike Stump clearly wrote it on a Model III: not only does it come on a TRSDOS 1.3 disk, but all executables use many Model III-specific RAM addresses like the top-of-memory and the command line. But I was able to make a Model I version by patching all "4411" bytes to "4049" and "4225" to "4318" (in zc/cmd, zas/cmd, zlink/cmd, and stdio/lnk, which is the C runtime.)
The linker is hilarious: whenever it hits an external function, it just asks YOU what the name of the library file is! The whereisz/doc file lists where each function is in which library. Note that some functions are in multiple libraries--you have alternates to choose from. And even then it expects you to PATCH (or SUPERZAP) in the end-of-program address.
But anyway it's a really neat system to make TRS-80 programs with C. For instance, I used ZC to write TRS-80 version of tenox's "aclock" program, which draws a live clock in text mode. I submitted it, and tenox accepted it!
You can find the source here:
https://github.com/tenox7/aclock/blob/master/sources/aclockm1-trs80-model1.c
https://github.com/tenox7/aclock/blob/master/sources/aclockm3-trs80-model3.c
And cmd files here:
https://github.com/tenox7/aclock/blob/master/binaries/z80/aclockm1-trs80-model1.cmd
https://github.com/tenox7/aclock/blob/master/binaries/z80/aclockm3-trs80-model3.cmd
One thing I would love to see would be the original source of the compiler, since it was clearly self-hosted. I wonder if anyone knows Mr. Stump and can ask him?
John D.