• ANN: A NEW HI-TECH C TREAT!

    From fridtjof.martin.weigel@gmail.com@21:1/5 to All on Wed Aug 11 17:43:18 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fridtjof.martin.weigel@gmail.com@21:1/5 to fridtjof.ma...@gmail.com on Thu Aug 12 09:48:12 2021
    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)
  • From Kurt Pieper@21:1/5 to All on Thu Aug 12 12:36:02 2021
    Hello fred,

    I think your contributions are excellent.

    I think there aren't that many Z80 users who have C experience.
    It's a small church.

    First I am learning HI-Tech C z80 for applications with i2c.

    Go on. I really enjoy reading the reports and testing them too.
    I run the program tiny.c on a sc114.

    Greetings from Germany
    Kurt

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From marblypup@yahoo.co.uk@21:1/5 to Kurt Pieper on Fri Aug 13 10:06:41 2021
    On Thursday, 12 August 2021 at 20:36:03 UTC+1, Kurt Pieper wrote:
    ... I think there aren't that many Z80 users who have C experience. ...
    I started using C on the ZX Spectrum (though I mostly used Basic, and a little bit of Lisp).
    My next computer was an Amstrad PCW8512 (CP/M at last!). I used C on that too (Mix C?) (also Mallard Basic and Turbo Pascal (great product!)). I can't remember if I used Hi-Tech C on the PCW, though I remember using a compiler which didn't handle
    prototypes, so 4*atan(1) was gibberish, not π. (4*atan(1.0) was fine, though.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From CP/M User@21:1/5 to marb...@yahoo.co.uk on Fri Aug 13 23:50:12 2021
    On Saturday, August 14, 2021 at 3:06:42 AM UTC+10, marb...@yahoo.co.uk wrote:
    On Thursday, 12 August 2021 at 20:36:03 UTC+1, Kurt Pieper wrote:
    ... I think there aren't that many Z80 users who have C experience. ...
    I started using C on the ZX Spectrum (though I mostly used Basic, and a little bit of Lisp).
    My next computer was an Amstrad PCW8512 (CP/M at last!). I used C on that too (Mix C?) (also Mallard Basic and Turbo Pascal (great product!)). I can't remember if I used Hi-Tech C on the PCW, though I remember using a compiler which didn't handle
    prototypes, so 4*atan(1) was gibberish, not π. (4*atan(1.0) was fine, though.)

    I would say the same for Amstrad CPC users, but instead of using a language on the CPC, they turn to their C like cross-compiler platform to produce a commercial like product for the CPC.

    In the meanwhile integrated BASIC languages are falling behind because other 8bit platforms have new variants with updates, all I can do is try the same, though is difficult when you're a person of 1.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)