Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
ZX Spectrum BASIC programming (1983) (worldofspectrum.net)
138 points by guytv on Nov 16, 2022 | hide | past | favorite | 53 comments


I have a copy of this on a shelf by my desk. From Chapter 1 - "Whatever else you do, keep using the computer. If you have the question “what does it do if I tell it such and such?” then the answer is easy: type it in and see. Whenever the manual tells you to type something in, always ask yourself, “what could I type instead?“, and try out your replies. The more of your own programs you write, the better you will understand the computer."


The other book that came with the machine has a quote that I think kicked off my career as an engineer - "Now that you have set up the computer, you will want to use it. The rest of this booklet tells you how to do that; but in your impatience you will probably already have started pressing the keys on the keyboard, and discovered that this removes the copyright message. This is good; you cannot harm the computer in this way. Be bold. Experiment. If you get stuck, remember that you can always reset the computer to the original picture with the copyright message by taking out the '9V DC IN' plug and putting it back again. This should be the last resort because you lose all the information in the computer."

I loved that machine.


Me too. I remember going through the "Beyond ZX Spectrum" was it? it had listings of basic programs for "Lunar Lander" and other nice games. With colorful inspiring screenshots of the running games.


Ah lunar lander, felt like so much code to type and I never got the darn thing to land without crashing!


Same here and I vividly remember that message "you can't harm computer". It really spoke to me.


Me too, here. It was a significant reassurance, and I was later disappointed to learn that the PC operating system did not have that same quality that earlier microcomputers had.


PCs were cobbled together in a way that earlier microcomputers were not - individual pieces of hardware could all be from different vendors, and adhering to a bunch of protocols, some of them proprietary. Then on top of that you had several different OS options (even if only considering DOS, there were still several), all of which had to support all the aforementioned hardware somehow. It's not surprising that nobody could guarantee the safety of all possible combinations - that's the price you pay for customizability.


You can if you short out the edge-connector with a coin; ask me how I know.


Also it turns out you can harm an Apple //e if you plug a //c mouse into its joystick port. Ask ME how I know, lol.


This print from the artist of the ZX Spectrum manual art may be of interest to some of you: https://www.alisoneldred.com/john-harris/fine-art-prints-1/s...

I have no affiliation other than having purchased the ZX81 manual's art print.


Amazing, thank you. The book holds a lot of memories for me. Since I'm currently redecorating my office, I think that print would be perfect.


I learned BASIC and English at roughly the same time because of this book. I had only learned the basics (aha!) at school but I wanted so much to learn how to program the machine that I kept at at, scaffolding one on top of the other. Amazing, if archaic, times..


I think some pages are missing?

My copy has a "Chapter 26 - Using machine code", and "Appendix A - The character set". The latter also lists all the Z80 opcodes, in both hex and decimal. Those were the really good parts of the book.


There were different versions of the manual, some thicker than others.


Here's a HTML version of the book (including the pages missing from the PDF): https://worldofspectrum.net/ZXBasicManual/index.html


Belatedly changed from http://zxnext.narod.ru/manuals/Basic_Programming.pdf above. Thanks!


Forty years later the NEW on on last line of the sample program on page 210 (line 170) still stings.

I typed in the program, it ran and then the NEW caused the interpreter to reset itself.

I think of it every time I save a file.


Oh wow, I love how the text warning you of that part is on the next page. Probably the facing page rather than after a page turn given that even-numbered pages are on the left, but still. What a wonderful example of the importance of layout. Possibly a deliberate choice.

And also: "Unfortunately it produces the patterns upside down, but you might not worry about this". C'mon, kid, don't you want to fix that? It'll be fun.


I also had this book with my 48k spectrum -- I was very young (around 7-8 I think) I would often ponder at the warning associated with this:

"the program will erase itself - this is to discourage you from using it frivolously."


I feel your pain.

After typing bilions of lines to have some inventory control (and other things, enough to run a little drugstore) I asked for help to type the remaining code. A relative came, typed "new" and pressed return.


Oh the pain!


After learning programming with this and the ZX81 book, Steve Vickers was (many years later) one of my lecturers at university. His course on Mathematical Structures was insanely complicated. If you want to read a genius / inscrutable / impenetrable CS paper, go and have a look at some of the ones he has co-authored: https://www.cs.bham.ac.uk/~sjv/papersfull.php#PtfreePtwise


That looks really interesting.

And I absolutely would not want to do an exam on it.


I thought I had the subject somewhat under control after a great deal of revision, but the mid year exam was mind boggling. MSc course at Imperial though, so you expect it to be hard.


I remember going into shops that had them on display with BBC Bs and Amstrads - 10 PRINT “EVERYONE WHO WORKS HERE IS AN IDIOT” 20 GOTO 10


Or the slightly less antagonistic version ;)

    10 PRINT "MARK IS COOL"
    20 GOTO 10


I never had this one, I started with the Spectrum+ manual in 1984, which was considerably smaller than this one but also a lot more colourful and inviting for an eight-year-old kid. I have very fond memories of typing in and eventually understanding the spider program in that book, even though I remember it took me a frustratingly long time to find the '|' character on the Spectrum keyboard for the spider's thread (Extend Mode, Symbol Shift-S).

https://ia904509.us.archive.org/35/items/NH2021_spectrumplus...


Just wanted to call out a couple of moments where this manual is far better than it needs to be, considering the target audience.

(from page 130) a description of calculating how long your ZX Spectrum has been powered on includes a discussion of the problem of a race condition when the counter ticks over

(from page 117) a program illustrating that the RND function uses a pseudo-random number generator


It's an exceptionally good manual, for many different reasons.


These kids now with their GPU's and their Inference chips, don't know how good they have it! We used to program just with zeros and ones, and some days...we had only zeros!


You can do a lot more today, but it was easier back when you could learn your way around an entire machine in a week.


Who needs binary when there is unary.


This brought back such warm memories. I didn't know any English then, but I just copied programs, ran them, and slowly learned some BASIC and some English while at it. :)


This brings back so many warm fuzzy memories. The ZX Spectrum was my first computer.


For those (like me) getting off on the nostalgia factor, there is a museum dedicated to the ZX spectrum and related PCs:

https://loadzx.com/en/


Oh man, the nostalgia! This was my first programming book. I started learning both programming and English from it.


Even though I was obsessed with computers I don't think I would have got half as far as quickly if I had to learn a whole other human language to do it! Real dedication!

I loved the (similar) ZX81 book so much that I bought a print of the cover art from the (same) original artist.

(Edit: Linked artist's site as a top level comment in case anyone else is interested in getting that)


The pages from 171 to 188 are missing: Chapters 25 (The system variables) and 26 (Using machine code) and Appendix A (The character set, with a disassembly table). All the fun stuff. I have still the third edition of the manual.


I owe my career to this book. I learnt binary from page 93 when I was about 8 years old so I could draw custom graphics on the screen (an airplane that i could fly around)


The version distributed in Italy in 1983, that is a (good) translation of this one linked in the story: http://www.rsp-italy.it/IT/Computers/Sinclair/_contents/Alla...


This reminds me of 'Start programming with the Electron' which came bundled with the Acorn Electron. You can see the cover at the bottom of this page:

http://classicacorn.computinghistory.org.uk/8bit_oem_comp/el...


I have such fond memories of the ZX-Spectrum. I learned how to program machine code using it (hand translates from Z80 assembler) when I was 11 years old. No internet. Nobody I could ask for help. Just a book explaining how to do machine code programming on a ZX-Spectrum. The satisfaction of getting this working was amazing to me.


"You can't harm the computer". I had a TRS-80 and my idea of fun was to write a short BASIC program that would poke random values into random addresses. Sometimes it would change a character in the program that would halt it, sometimes it would lock up. Just a quick off and on and try it again.


I learned from the very similar ZX81 manual, and for a very long time still used it as my handy guide to Z80 mnemonics :-)


The description of the trig functions on page 69 taught me those way before we encountered them in school.

The manual has those clear memory maps and it even describes the way numbers are encoded in the tokenized BASIC program memory, with the exponent sign and mantissa encoding. This really was a remarkable book.


Does anyone know where the cover art for he ZX81 programming book came from? (https://issuu.com/old-computers/docs/zx81basicprogramming)

I remember being fascinated by it as a child.



If you end up buying it then I recommend getting museum glass when you frame it - the picture is quite dark so it's likely to be too reflective otherwise.


Fabulous book and a great introduction to programming in 1982. It put me on the road to a career in development.


The cover is absolutely amazing and I still regret selling the book.


It's by John Harris. I also love the ZX81 BASIC manual.

http://www.alisoneldred.com/john-harris/fine-art-prints-1/sc...


I remember having the hardcopy when I was a child (got an old ZX Spectrum in the beginning 90s)... probably one of the first programming books I've ever had and read myself.


A piece of my childhood. Although at that time I could appreciate much of it. Do you have more Spectrum manuals? I remember for sure there were more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: