From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.8 required=3.0 tests=BAYES_00,PLING_QUERY autolearn=no autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Adapting an Ada compiler to generate 8051 code (Again?! ;-) Date: Thu, 1 Apr 2021 18:43:45 -0500 Organization: JSA Research & Innovation Message-ID: References: <41bc7a62-9c70-466d-b316-5fc74a3ee845n@googlegroups.com> <87im58a1up.fsf@nightsong.com> <87a6qk9uua.fsf@nightsong.com> Injection-Date: Thu, 1 Apr 2021 23:43:46 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="22775"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:61723 List-Id: "Luke A. Guest" wrote in message news:s44du6$ugk$1@gioia.aioe.org... > On 01/04/2021 00:20, Randy Brukardt wrote: >> "Luke A. Guest" wrote in message >> news:s40urd$qbp$1@gioia.aioe.org... >> ... >>> AVR isn't really an accumulator arch, it's got 32 registers. Even the >>> 6502 >>> has a port, but that uses the zero page as virtual registers. The Z80 >>> cannot do that as it starts executing from address 0 iirc. >> >> The Z-80 has enough registers for Ada (or at least a reasonable >> subtest) -- >> see the original Janus/Ada compilers. If you want *real* registers, even >> the > > I know of the original Janus for Z80, never used it, is it a real Ada > compiler or is it a Pascal like Ada? It was an Ada 83 subset. Don't remember the exact details, but it covered a substantial part of the language, including packages and exceptions. The validated Ada 83 compilers were direct descendants, and the current compiler is directly descended from that. > Have you considered compiling it as a cross compiler on Linux? Sadly, we've lost the back-end. When I was moving and going to junk the last machine with a working 5 1/4" floppy, I decided to copy all of the old stuff into the version control system. But I wasn't able to read the disks with the source to the last pass. I didn't concern myself too much with losing that, as that backend predated J-Code and thus any modern version would need to be rewritten anyway to mate with a modern front-end. I did manage to recover the runtime, which would be more work to reproduce anyway -- especially the floating point library. >> x86 doesn't have enough registers for reasonable code optimizations. A > > Tell me about it. Always hated the x86 when I was on m68k, look I have 8 > Data and 8 Address registers, you have what? 4 useable ones! 6 registers on the x86 (as SP and BP have special purposes -- one can use them [especially BP] in a pinch but you have to save the contents). It's just enough to be more than enough for most simple purposes and thus a bit of longer term register allocation is needed. The Z-80 for instance didn't need any register allocation as with essentially 3 there wasn't any point in trying to keep anything there. Randy.