On Wednesday, August 11, 2021 at 8:43:19 PM UTC-4,
fridtjof.ma...@gmail.com wrote:
https://github.com/ratboy666/tiny
is a new hi-tech C treat
Introducing csup.rel - the minimal c support library. tiny.c compiles, convert to REL, and links (hello world style program). The final
executable? 128 bytes. All C.
Enjoy
This is because I am doing some bit-twiddling for APU, and wanted to
get away from the assembler drudge. Maybe this will help -- was
thinking this may be possible today, and I threw it together.
"Back in the day" I used Whitesmiths C. In my opinion the best native C compiler for 8080. I got my Altair-Duino about a year ago, and wanted
a C compiler. HI-TECH C had prototypes -- a big plus! So, gave it a
whirl. The worst thing? Only Z80 (no 8080). For 8080, I can de-proto
the source and run through Whitesmiths (but, the Altair-Duino supports
Z80 as well -- and Turbo Pascal needs it). But, modulo a few bugs (so
far, only 2 bugs in code generation -- which is actually very good). The compiler actually takes slightly less memory than Whitesmiths.
The "fixable" issue was that HI-TECH insists on using its on object,
library formats. I find that very annoying. Whitesmiths was popular
enough that PSA PLINK-II support the Whitesmiths REL format.
But, the OBJ for HI-TECH? Not so much. This forced me to use
the HI-TECH assembler, linker, the whole toolchain. Not my cup of
tea. I really like M80 (at least it properly supports 8080, Z80, and
macros). So, I invested some time in reverse engineering wtf
was going on with the HI-TECH formats. I don't really care what the REL
format is -- just that it is MicroSoft and Digital Research. Months of
toil resulted in AS to MAC which I used to port the HI-TECH runtime
to REL format. But that was not "ok" -- ran into another bug with
HI-TECH that I doubt anyone would have reasonably forseen. If the C
compiler is told to generate assembler, not object, it (sometimes)
produces AS files that don't assemble. This was vexing, but I used
my notes on OBJ to produce OBJ to MAC. Then, M80 and we are
"good to go". Note that my use of M80 to generate REL from MAC is
just a labour saving device (it avoids the need for me to understand
REL files).
After this "correction", HI-TECH C is doing an absolutely stellar job for me. Now that I have it "tamed", I can use it to produce ultra-small executables (tiny.com), mix with FORTRAN-80 or BASIC-80 (mixed). Now that
standard REL files are used, we can use PLINK-II for linking and
overlays.
If someone knows the original author(s) of HI-TECH C, send
my regards. This compiler has truly stood the test of time!
I assume that the original source is lost -- I know that
https://github.com/nikitinprior
has being doing great work in regenerating source, and
making improvements,
https://github.com/agn453/HI-TECH-Z80-C
has been collecting stuff related to the compiler.
Hi-TECH C 3.09, 35 years old -- now officially my favorite compiler.
And beating my own drum - my Hi-TECH C work
https://github.com/ratboy666/tiny
https://github.com/ratboy666/mixed
https://github.com/ratboy666/mtrel
If you haven't tried it... give it a spin! Damn, it is that good.
Now -- onto the "real meat". I am thinking of replacing NCSV, CSV and CRET functions
with a profiler/run-time optimizer. How much interest, if any, is there in that?
Fred Weigel
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)