UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 22nd May 2023, 10:09 pm   #1
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,087
Default Programming the Z80 without RAM

This resurrection of a 40-year old Morse, Rtty & Ascii converter Z80 project follows a chat with Brian Chiha (of the "Ready? Z80" channel on Youtube) and might be of general interest... Z80 programming with no RAM ! Its in the "Random projects & files" section of http://philg.uk
The original source file was developed almost 40 years ago on my Eaca Colour Genie for which the tapes are long lost - all that remained to be recently rediscovered in my loft, was an actual working PCB and a faded, rolled-up printout - which wasnt the final version. In a burst of nostalgic enthusiasm, I've spent a couple of evenings disassembling the original eprom and with help from the barely legible printout, recreated the complete & final source.
It assembles fine with either AZ80 or with Zen which I used on the Colour Genie, and which I've ported to the RC2014 mini/micro.
The object code is just under 2k and fits into a 2716 eprom with only a few bytes to spare.
The key thing behind this project, and the main driver for resurrecting it, is that it uses no RAM - the PCB has only a Z80, PIO, clock and eprom, it has no read-write memory at all!
Of ocurse I wouldnt expect anyone to build this in 2023, but Brian posted a video about programming without RAM and this got us talking, & I thought maybe after all the effort I'd share it. Fortunately I always use plenty of source code comments to give myself a chance of remembering what I did...
Cheers
Phil
Phil__G is online now  
Old 22nd May 2023, 10:25 pm   #2
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,265
Default Re: Programming the Z80 without RAM

I couldn’t be bothered to download the zip to check the code but a 2k assembler program probably needs to use subroutines. So without ram for a stack I guess you can use Jp (hl/ix/iy) for return addresses.
Mark1960 is offline  
Old 22nd May 2023, 10:41 pm   #3
Timbucus
Octode
 
Join Date: Mar 2019
Location: Barry, Vale of Glamorgan, Wales, UK.
Posts: 1,362
Default Re: Programming the Z80 without RAM

Had a quick look through the code - worked out the JP (IY) and then read the article which leads with it - duh. Anyway very reminiscent of SC/MP code with only the pointer registers available. I suppose you could use the alternate set as well (EXX) with EX DE,HL serving to provide more storage and allow use of JP (HL)
Timbucus is offline  
Old 25th May 2023, 6:55 pm   #4
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,087
Default Re: Programming the Z80 without RAM

More of the same, another old zero RAM project - I found my old Morse Tutor board, still works fine, same eprom-only Z80 hardware as the morse/rtty decoder, fits in a cassette-tape case. Again I've disassembled the eprom to recreate the long-lost Z80 source. "Random projects" page of http://philg.uk
I'd be interested to hear thoughts on the "pseudo-random" number generator - I have no clue where I got this from 40 years ago, very simple but it kinda works !
Take a 16-bit seed, then in a loop multiply it by 257, add 41 and ignoring overflow take the MSB of the result as the "random" number. Loop for the next one. Random-ish?
It must have come from a magazine, I would never have worked that out!
Attached Thumbnails
Click image for larger version

Name:	morse_tutor_no_ram.jpg
Views:	68
Size:	110.2 KB
ID:	278746  

Last edited by Phil__G; 25th May 2023 at 7:20 pm.
Phil__G is online now  
Old 26th May 2023, 11:18 am   #5
dominicbeesley
Octode
 
dominicbeesley's Avatar
 
Join Date: Nov 2004
Location: Hebden Bridge, West Yorkshire, UK.
Posts: 1,885
Default Re: Programming the Z80 without RAM

I recently wrote a test rom to exercise a z180 cpu transplanted into a bbc micro https://github.com/dominicbeesley/bl...s/test-mos.asm

The rom needed to exercise memory but not rely upon it for operation. I didn't think to use registers for subroutines...mainly because this rom is a clone of a 6502 rom where that isn't possible.

Very sc/mp-ish

D
dominicbeesley is offline  
Old 26th May 2023, 1:59 pm   #6
lesmw0sec
Octode
 
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,498
Default Re: Programming the Z80 without RAM

Back in the 80's, I designed a controller for ML Aviation, used to measure airport runway friction. That used a Z80 with no ram. Did the subroutines as described above. Ended up using every register in one form or another, as it had to do some arithmetic and drive a printer.
lesmw0sec is online now  
Old 26th May 2023, 2:17 pm   #7
lesmw0sec
Octode
 
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,498
Default Re: Programming the Z80 without RAM

Just realised - I still have a photo of the ML unit!
Attached Thumbnails
Click image for larger version

Name:	T-178.jpg
Views:	67
Size:	76.0 KB
ID:	278775  
lesmw0sec is online now  
Old 26th May 2023, 2:31 pm   #8
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Programming the Z80 without RAM

Although it's a clever thing to be able to do it seems a bit extreme to do this just to save having a RAM IC in the system. The workarounds needed to ensure you never have to call subroutines or keep variables in RAM in the normal way could mean you end up having to use a much bigger EPROM than you meant to.

I can obviously understand and appreciate the skill involved in writing, say, system test EPROMs which don't need any of the system RAM to work so that they can run regardless of whether the system RAM is present / absent or faulty.

Maybe I'm just lazy.
SiriusHardware is online now  
Old 26th May 2023, 4:06 pm   #9
lesmw0sec
Octode
 
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,498
Default Re: Programming the Z80 without RAM

Quote:
Originally Posted by SiriusHardware View Post
Although it's a clever thing to be able to do it seems a bit extreme to do this just to save having a RAM IC in the system. The workarounds needed to ensure you never have to call subroutines or keep variables in RAM in the normal way could mean you end up having to use a much bigger EPROM than you meant to.

I can obviously understand and appreciate the skill involved in writing, say, system test EPROMs which don't need any of the system RAM to work so that they can run regardless of whether the system RAM is present / absent or faulty.

Maybe I'm just lazy.
In the case I raised, it was necessary due to lack of PCB space. The requirements were to replace an earlier TTL version, but the catch was that it should use identical size PCB's and the existing wiring harness, so that older units could be upgraded. I seem to recall managing it with just one spare wire in the loom...
lesmw0sec is online now  
Old 26th May 2023, 4:29 pm   #10
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,087
Default Re: Programming the Z80 without RAM

I made a few of these rom-only boards back then, mine were inspired by the "Minimal Z80" shown in Zilog Applications Manual. Re EPROM size, I'd say the morse/rtty/ASCII reader is a fairly, well, not 'complex' but shall we say 'substantial' project, and it uses the smallest of the common eproms, a 2716
RAM would have made things much, much easier but as with all my stuff, it was done for fun and a bit of a challenge!
BTW the ML unit is the first serious no-ram application I've seen!
Cheers
Phil
PS can anyone throw any light on where I might have found that dodgy pseudo-random character generator in the Morse Tutor code?

Last edited by Phil__G; 26th May 2023 at 4:38 pm.
Phil__G is online now  
Old 26th May 2023, 6:39 pm   #11
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,265
Default Re: Programming the Z80 without RAM

Quote:
Originally Posted by Phil__G View Post
PS can anyone throw any light on where I might have found that dodgy pseudo-random character generator in the Morse Tutor code?
No, but this thread on 6502.org might be of interest.
http://forum.6502.org/viewtopic.php?f=2&t=587&start=195

Were there any other input/output devices that included RAM other than the 8154 or 8155? 8155 would be tricky to use with a z80 due to multiplexed address and data. It would probably make more sense to use 8748/9.
Mark1960 is offline  
Old 27th May 2023, 4:34 am   #12
TonyDuell
Dekatron
 
Join Date: Jun 2015
Location: Biggin Hill, London, UK.
Posts: 5,191
Default Re: Programming the Z80 without RAM

I could be ridiculously pedenantic and mention the 8156. Which is an 8155 with an active-high chip select line.

There's also the 6532 RIOT (RAM, I/O, Timer) in the 6502 family
TonyDuell is online now  
Old 27th May 2023, 6:45 pm   #13
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: Programming the Z80 without RAM

This is one originally published in Talking Electronics I built a while ago as a bit of lock-down project. Was not sure quite what to do with it once finished so set it up to be a clock with a VFD display, even used the 50Hz mains as the time source to keep it really old school.
Attached Thumbnails
Click image for larger version

Name:	Image (2).jpg
Views:	37
Size:	93.3 KB
ID:	278818   Click image for larger version

Name:	Image.jpg
Views:	45
Size:	106.1 KB
ID:	278819  
DavidMS is offline  
Old 27th May 2023, 8:13 pm   #14
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,087
Default Re: Programming the Z80 without RAM

Brilliant! I love that display David
Talking Electronics has an active FB group
Brian did a video on the Microcomp, I'd never heard of it until I got chatting to him recently
https://www.youtube.com/watch?v=iamr3gj8vU8
He does a great channel by the way, well subbing !
Phil__G is online now  
Old 27th May 2023, 10:53 pm   #15
Timbucus
Octode
 
Join Date: Mar 2019
Location: Barry, Vale of Glamorgan, Wales, UK.
Posts: 1,362
Default Re: Programming the Z80 without RAM

Ah I went searching for that as I had seen it sometime ago when I read this thread - love the VFD and use for the machine David.
Timbucus is offline  
Old 28th May 2023, 7:51 am   #16
TonyDuell
Dekatron
 
Join Date: Jun 2015
Location: Biggin Hill, London, UK.
Posts: 5,191
Default Re: Programming the Z80 without RAM

As an aside I have a Marconi TF2828 'digital simulator', a test data generator for digital telephone trunks.

One of the boards in the unit, used only for one of the functions, is a small 8085-based computer system. It contains the processor, 8K EPROM (3 off 2716 and an 8755) and even a 8*8 multiplier IC, but no RAM. And no, the processor bus is not brought off the board to RAM somewhere else.
TonyDuell is online now  
Old 28th May 2023, 8:34 am   #17
jjl
Octode
 
jjl's Avatar
 
Join Date: Jan 2003
Location: Ware, Herts. UK.
Posts: 1,082
Default Re: Programming the Z80 without RAM

When I worked at Solid State Logic in the late '80s, a fellow software engineer told me that each of the bar-graph VU / PPM meters for the SL5000 broadcast mixing desk was implemented using a Z80 with no RAM. He told me that full use was made of the poor old Z80's registers; including the interrupt vector (I) register.

John
jjl is online now  
Old 28th May 2023, 9:44 am   #18
lesmw0sec
Octode
 
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,498
Default Re: Programming the Z80 without RAM

Quote:
Originally Posted by jjl View Post
When I worked at Solid State Logic in the late '80s, a fellow software engineer told me that each of the bar-graph VU / PPM meters for the SL5000 broadcast mixing desk was implemented using a Z80 with no RAM. He told me that full use was made of the poor old Z80's registers; including the interrupt vector (I) register.

John
Spookily enough, I did a similar exercise to produce a bar graph display on a device which monitored the strain on metal presses for stamping jam-pot lids, so the machine stopped if a double thickness of plate crept in. That did use an eeprom, but only so that the settings could be recalled from power down.
lesmw0sec is online now  
Old 29th May 2023, 10:21 am   #19
coredump
Triode
 
Join Date: Jan 2005
Location: Bristol, UK.
Posts: 37
Default Re: Programming the Z80 without RAM

A few years ago, I built an RC2014 PCB using parts I already had lying around. As part of that project, I wrote a Z80 machine-code monitor that could test the machine without assuming the RAM was working. So, I could not use CALL and RET instructions because they use the stack, which is in RAM.


I put the source code on GitHub, here:


https://github.com/anachrocomputer/RC2014tester


Hope it's useful to somebody!
coredump is offline  
Old 29th May 2023, 12:22 pm   #20
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,087
Default Re: Programming the Z80 without RAM

This is brilliant, I did wonder whether a couple of slightly weird 40-year-old projects would be of any interest at all, and lo & behold it prompts so many great stories and projects
Thanks everyone! (but keep them coming...)
Phil
Phil__G is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 11:14 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.