RetroChallenge 2021/10 - Am9511 APU with 8085 CPU Module

1st Update - 2nd October.

Getting to Am9511A APU support for the RC2014-8085 machine means firstly getting the fundamental 8085 platform working.

The RC2014 is supported by the “newlib” of Z88DK, which is meant for Z80, Z180, Z80N (Spectrum Next) processors, and the 8085 is supported by the “classic” library. So this is the first time that a newlib machine is using classic lib libraries. Confusing? Yes I find it so.

Anyway the trick is just getting the right pieces to link together. Having ZIF ROM and TL866CS Programmer helps with fast programming cycles.

Next step is to rework the 8085 CPU Module hardware to support an IO wait state.

2 Likes

Now the z88dk RC2014-8085 ROM build using the ACIA Serial Module is working (along with the RAM build supported by Basic), I’ve spent the past days tidying the ACIA builds around my various repositories, to keep everything consistent. So now my BASIC builds for both 8085 and Z80 are aligned with RC2014 HexLoadr BASIC, CP/M-IDE ACIA, and also the z88dk ACIA newlib device code. Also took the time to clean up some the SIO device code too.

@suborb is working on the z88dk crt0 and compiler intrinsics, as they’ve been stuck in both classic and newlib and are a bit disorganised. Hopefully the result will be one set that can be used for both compilers (zsdcc, and sccz80) and both libraries, across multiple machines (8080, 8085, GBZ80, Z80, Z180, Z80N, etc) which will make maintenance much easier.

Waiting now for China to come back from National Day holiday, so I can get started with new hardware.

1 Like

3rd Update - 8th October.

On wait state generation to support the Z80 /WAIT signal. A design derived from the suggested standard has been finished. A PCB was ordered, and should arrive within a few days.

hi feilipu,
nice diagrams, especially the curved corners, not something I’ve seen before. Is that in KiCAD ?.
also, how do you get PCBs in a few days, mine take a couple of weeks. maybe because I pay for cheapest postage :slight_smile:
cheers,
Mark-C

nice diagrams, especially the curved corners, not something I’ve seen before. Is that in KiCAD ?

Thanks for commenting. It comes from Eagle. I picked up a “Hobby” version some years ago (4 layer x 160mm x 100mm), but I haven’t upgraded from v6.6 because of the cost.

I like the curves, because they allow my eyes to follow a trace more easily around corners. I tend to lose my thread in a field of vertical and horizontal lines when there’s no “hinting” from the curve.

I also like curves on the physical layout. Not that my designs run fast enough to have to worry about reflections, but it just looks nice.

How do you get PCBs in a few days, mine take a couple of weeks. maybe because I pay for cheapest postage.

I have settled on SeeedStudio Fusion for PCBs. They’re usually back with a PCB within about 5-7 days, as their normal shipping option is with DHL.

But over Chinese National Day (Oct 1) they’re shut down for 10 working days. So this time I sent the order just before they shut down (knowing this would happen) and it probably will get me a new PCB by Oct 18th.

P.

4th Update - 12th October.

Updated the z88dk rc2014 target basic85 and acia85 subtypes to support playing startrek.

1 Like

hey feilipu,
there couldn’t be a more worthy program to run on your RC2014 project.
I can recall playing Star Trek on a DECwriter at SAIT (South Australian Institute of Technology) back around 1978. A friend of mine got us in there to play on the terminals even though neither of us were students there.
One of my future projects is to get ALTAIR 680 BASIC on my ET-3400 so I can run Star Trek or Life.
cheers,
Mark C.

1 Like

5th Update - 13 October.

Something new and shiny has arrived earlier than promised. So I’ve quickly built it up to test. And it works with both the APU Module (main goal for my RetroChallenge), and it also works with my UX Module (Propeller based VGA interface), so double great news. Very happy with progress to date.


1 Like

6th (Final) Update – 26th October

Rework of z88dk classic 8080/8085/gbz80 library functions.

When working with the 8085, the biggest issue is the continual pressure on the few CPU registers. The 8-bit accumulator a register and the 16-bit accumulator hl registers have only two additional pairs that can be used, the bc and de registers. This gives the system programmer few options but to use (static) memory locations to store intermediate values, leading to non-reentrant code.

Having non-reentrant code is normally not a problem, but it leads to issues when multiple threads (or tasks) are trying to use the CPU at the same time. So it is useful to try to build reentrant functions that use the stack for storage of intermediate values, rather than static locations.

The designers of the 8085 had this in mind when they designed the additional functions found the 8085 silicon. The “new” instructions make it very efficient to build stack relative functions (compared to the 8080), and this relieves some pressure on the small number of registers.

However, there was one oversight made by the designers, as the 8085 af register pair cannot be used, as with the z80, to pop and push words from the stack. This reduces the number of available 16-bit registers by 1 of possible 4. There is one flag bit that always reads as 0, which is an subtle but annoying limitation in the 8085.

For the past two weeks I’ve been working on a refresh of all of the integer and long basic compiler (l_) functions to try to make them reentrant and, where possible, to optimise them for the 8085 CPU. I’ve also moved the improvements to the 8080 CPU and Gameboy Z80 CPU where possible too.

As background, some of these functions originate from the 1980s and 1990s in the Amsterdam Compiler Kit, and haven’t been updated or improved for the past 20 years. They weren’t broken. But they were in need of some reentrant attention.

So this update is the final and biggest one in the October 2021 RetroChallenge. All the new functions are checked in and are now part of the z88dk.

1 Like