Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How was the Spectrum ROM written?

363 views
Skip to first unread message

BitNaughty

unread,
May 21, 2010, 11:00:53 AM5/21/10
to
Did they actually write the BASIC interpreter in Asm, ON the Spectrum?
(My GOD!)
Or did they write it on a higher end machine in a high level language,
which had a compiler that could generate Z80 code? (even then, a
phenomenal feat!)
Who actually wrote it? Is he/she around today?


Thanks.

Geoff Wearmouth

unread,
May 21, 2010, 12:32:03 PM5/21/10
to

Yes I would love to know the answers to your questions.
Even by 1985 I didn't know who had written the ROM only clues.
It had appeared in magazines published before 1983 when I bought my
Spectrum but blink and you missed it.
It started off as the 4K ZX80 ROM written by John Grant of Nine Tiles.
Steven Vickers was brought in to upgrade this ROM for the ZX81.
This 8K ROM was further expanded by Steven Vickers for the colour ZX
Spectrum.

PCW offered a fiver for the author of ZX80 ROM after Sir Clive would
not tell and it was won by his son Crispin Sinclair his who revealed
it to be John Grant.
After graduating from Selwyn College in Maths, John worked for the
Cambridge Maths Lab, later christened the Computer Lab and so had
exposure to all the latest hardware and assemblers.
I have found Universities to be very supportive of companies in
lending facilities and there may have been some such assistance for
John and his company Nine Tiles Information Handling. On the other
hand I have seen a photo of Vickers programming the Jupiter Ace ROM on
very primitive looking hardware.
Steve Vickers worked with John on the ZX81 ROM and manual. The ZX81
manual states that the ROM was written by a small firm of Cambridge
mathematicians.
Around that time there were six in the team. John Grant and his wife
Kate Grant directors, Steve Vickers and Penny Vickers, his sister,
both Cambridge mathematicians.
The other two are unknown to me. Anyone?
Steve spent half his time at Nine Tiles and half his time at 6 King's
Parade which is the only place he could test his code.

They are still around today.

John and Kate are into networking
http://www.cambridge-news.co.uk/Business/Im-sorting-out-the-traffic-on-the-hi-tech-M25.htm

The Government has awarded Steve a grant of over £300,000 to apply his
mathematical research to quantum theory and he also teaches Quantum
Topos theory at the Midland Graduate School. Sister Penny, who wrote
parts of the Spectrum manual, (and possibly more) continues to cut
Classical records and is an Alto with the BBC Singers.

--
G.


Walter Banks

unread,
May 22, 2010, 10:08:37 AM5/22/10
to

I don't have specific knowledge of the Sinclair basic other than
I was working on competitive systems at the time. I had a conversation
with Ian Logan about the ZX-81 basic implementation around the
time he published his disassembly of the ZX-81 roms. At the time
it was assumed they had been written in asm code.

http://scratchpad.wikia.com/wiki/Sinclair_BASIC_History
Mentioned that the ZX-80 basic was written in asm and
later basic used parts of the zx-80 code.

There were a handful of basics written for the Z80 at the time
and all of the ones I know details on were written in asm. For
quite a while the only available C compilers or cross compilers
for the Z80 were tiny C implementations which were little more
than C to asm translators with little optimization that generally
only used a subset of the target instruction set.


Regards,


Walter..
--
Walter Banks
Byte Craft Limited
http://www.bytecraft.com

--- news://freenews.netfront.net/ - complaints: ne...@netfront.net ---

Geoff Wearmouth

unread,
May 23, 2010, 8:31:06 AM5/23/10
to
On 22 May, 15:08, Walter Banks <wal...@bytecraft.com> wrote:

> I don't have specific knowledge of the Sinclair basic other than
> I was working on competitive systems at the time. I had a conversation
> with Ian Logan about the ZX-81 basic implementation around the
> time he published his disassembly of the ZX-81 roms. At the time
> it was assumed they had been written in asm code.

Yes the ASM listing for the Z80 was serialized in SYNTAX magazine in
America and the entire file was advertised for $40.
Although considered a one-man job the display and keyboard reading
routines must have already been written by chief Sinclair engineer Jim
Westwood who had a cameo in the recent BBC documentary drama 'Micro
Men'. It's very clever hand-crafted assembler which uses the same
number of clock-cycles whichever branch is taken. It had an annoying
flicker and 'according to Steven Vickers, Westwood worked miracles on
his improvement of the video display, 'coming up with a technical
dodge using non-maskable interrupts' to solve the flicker
problems.' [for the ZX81]

http://www.nvg.ntnu.no/sinclair/computers/zx81/zx81_sst.htm

Dr Logan was invited to fly over to Timex and assist them in their
designs. He wrote the ROM software for the Sinclair microdrives
accessed by the Interface1 peripheral and he also wrote a Spectrum
test ROM for engineers and retailers.

--
G.

OwenBot

unread,
Jun 22, 2010, 5:33:16 AM6/22/10
to

All can now be revealed. Chris Smith asked me to ask John Grant of
Nine Tiles (which produced the ROM) so I did. I'll update the history
article at some point.

The code for the ZX80, ZX81 and ZX Spectrum was written in assembly
language, by hand, on paper, with a pencil. The code was assembled on
a Zilog ZDS-1 system using Zilog's assembler.

http://archive.computerhistory.org/resources/text/Zilog/Zilog.ZDS1.1977.102646173.pdf

John believes the machine used for the ZX81 and ZX Spectrum ROMs may
have been smaller than the one used for the ZX80 ROM and with only one
disk drive, but it was the same blue colour. That's probably as close
as we're going to get to the specific models involved.

The ZX80 ROM was written by John Grant. The ZX81 ROM was written by
Steven Vickers although it retains quite a lot of code from the
earlier ZX80 ROM. The ZX Spectrum ROM is essentially an expanded
version of the ZX81 ROM with colour and support for the ZX Spectrum
hardware. It retains about 8K of ZX81 code. Most of the math code is
unchanged (this is from my own forensic analysis of the code).

More details to follow in the updated BASIC article (when I get around
to it) and in Chris Smith's ULA book.

Brian Gaff

unread,
Jun 23, 2010, 3:47:09 AM6/23/10
to
I seem to recall that Circles were drawn by a routine actually written in a
higher level language and compiled, and this was why it was so slow.

I must also say though that the manuals for the ZX computers, the thick
ring bound ones and of course the real +2/3 ones were very well done
compared to many other offerings at the time, because although they did
contain techy stuff, they hasd a homly feel in their explanations, not
resorting to buzz words and jargon.


Brian

--
Brian Gaff - bri...@blueyonder.co.uk
Note:- In order to reduce spam, any email without 'Brian Gaff'
in the display name may be lost.
Blind user, so no pictures please!
"OwenBot" <chev...@gmail.com> wrote in message
news:d43a4954-7409-40c5...@5g2000yqz.googlegroups.com...

OwenBot

unread,
Jun 23, 2010, 4:38:28 AM6/23/10
to
The CIRCLE routine is written using the calculator's own internal
Forth-like language, so it seems unlikely that it could have been
compiled, unless it was compiled from something even higher level into
Forth. The two main reasons that it is slow are that it makes repeated
calls to the square root function (which was optimized for space, not
speed) and that it's rather more precise than it needs to be for the
display resolution of the Spectrum. You'll find CIRCLE is considerably
faster in SE Basic where the square root function is the Newton
Raphson method and the redundant precision has been removed from the
routine.

On Jun 23, 8:47 am, "Brian Gaff" <Bria...@blueyonder.co.uk> wrote:
> I seem to recall that Circles were drawn by a routine actually written in a
> higher level language and compiled, and this was why it was so slow.
>
>  I must also say though that the manuals for the ZX computers, the thick
> ring bound ones and of course  the real +2/3 ones were very well done
> compared to many other offerings at the time, because although they did
> contain techy stuff, they hasd a homly feel in their explanations, not
> resorting to buzz words and jargon.
>
> Brian
>
> --

> Brian Gaff - bria...@blueyonder.co.uk


> Note:- In order to reduce spam, any email without 'Brian Gaff'
> in the display name may be lost.

> Blind user, so no pictures please!"OwenBot" <cheve...@gmail.com> wrote in message


>
> news:d43a4954-7409-40c5...@5g2000yqz.googlegroups.com...
> On May 21, 4:00 pm, BitNaughty <bit-naug...@hotmail.com> wrote:
>
> > Did they actually write the BASIC interpreter in Asm, ON the Spectrum?
> > (My GOD!)
> > Or did they write it on a higher end machine in a high level language,
> > which had a compiler that could generate Z80 code? (even then, a
> > phenomenal feat!)
> > Who actually wrote it? Is he/she around today?
>
> > Thanks.
>
> All can now be revealed. Chris Smith asked me to ask John Grant of
> Nine Tiles (which produced the ROM) so I did. I'll update the history
> article at some point.
>
> The code for the ZX80, ZX81 and ZX Spectrum was written in assembly
> language, by hand, on paper, with a pencil. The code was assembled on
> a Zilog ZDS-1 system using Zilog's assembler.
>

> http://archive.computerhistory.org/resources/text/Zilog/Zilog.ZDS1.19...

Dylan Smith

unread,
Jun 23, 2010, 8:22:02 AM6/23/10
to
On 2010-06-23, Brian Gaff <Bri...@blueyonder.co.uk> wrote:
> I must also say though that the manuals for the ZX computers, the thick
> ring bound ones and of course the real +2/3 ones were very well done
> compared to many other offerings at the time, because although they did
> contain techy stuff, they hasd a homly feel in their explanations, not
> resorting to buzz words and jargon.

And since back in the day I had a Spectrum+, I ended up with the
Dorling Kindersley effort. I was very disappointed at the time, because
the rubber key Speccy we had at school had the very good Orange Book.

When I got my +3, I was glad to see Amstrad had reverted to supplying
proper manuals with the Spectrum again.

Robert Baker

unread,
Jun 23, 2010, 10:07:06 AM6/23/10
to
On Wed, 23 Jun 2010 01:38:28 -0700 (PDT), OwenBot <chev...@gmail.com>
wrote:

>The CIRCLE routine is written using the calculator's own internal
>Forth-like language, so it seems unlikely that it could have been
>compiled, unless it was compiled from something even higher level into
>Forth. The two main reasons that it is slow are that it makes repeated
>calls to the square root function (which was optimized for space, not
>speed) and that it's rather more precise than it needs to be for the
>display resolution of the Spectrum. You'll find CIRCLE is considerably
>faster in SE Basic where the square root function is the Newton
>Raphson method and the redundant precision has been removed from the
>routine.

Reminds me of the early '70s; I sped up a graphics prog written in
FORTRAN by using my own SIN and COS functions which evaluated only to
the number of places needed, not the much larger standard number...

Geoff Wearmouth

unread,
Jun 23, 2010, 4:49:17 PM6/23/10
to
Nice research on the ROM origins. Most welcome.

The CIRCLE command is the most hand-crafted code in the Spectrum and
it does with DRAW make the most use of the calculator.
Routines written using the calculator involve extensive calls to test
free memory - 1315 for a circle , 172 for the original SQR routine.

It is rewarding but difficult to read the CIRCLE routine. The reason
is that redundant code has been left in there to revisit perhaps.

Originally the number of sides could be 1-255 inclusive but at some
stage it was found that circles looked better when the top and bottom
were horizontal
and the sides vertical. To accomplish this the number of sides was
made divisible by 4 - i.e range 4 to 252 in steps of 4. The control
loop was changed from DJNZ to a calculator loop but the redundant DJNZ
is still in there.

--
Spectrum Circles and Arcs
http://www.wearmouth.demon.co.uk/jav/onerr.htm

chrisj...@gmail.com

unread,
Oct 28, 2019, 6:50:59 AM10/28/19
to
On Tuesday, June 22, 2010 at 10:33:16 AM UTC+1, OwenBot wrote:
> On May 21, 4:00 pm, BitNaughty <bit-naug...@hotmail.com> wrote:

> John believes the machine used for the ZX81 and ZX Spectrum ROMs may
> have been smaller than the one used for the ZX80 ROM and with only one
> disk drive, but it was the same blue colour. That's probably as close
> as we're going to get to the specific models involved.
>

What is a decade amongst enthusiasts? The small, single disc version of the Zilog development system was called a PDS (personal development station) and was about half the cost. I bought one in 1977 (from memory it was well over £2000, a LOT of money in those days - my father thought I was mad) and used it to develop ASZMIC and my other Sinclair stuff. I still have it in the loft, but I think I inadvertently threw out all the 8" floppies when I moved 13 years ago so it is not much use. It came with the same software as its big brother, but only a separate single disk drive and a lot less memory.

Regards
Chris
0 new messages