Assembly Language Assembled for the Sinclair ZX81

General Chit Chat about Sinclair Computers and their Clones
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Assembly Language Assembled for the Sinclair ZX81

Post by Lardo Boffin »

I'm currently trying to learn Z80 on the ZX81 (hence the sporadic posts about how to do stuff when I actually get time to write programs) and therefore buy the occasional book off eBay when they come up.
I saw Assembly Language Assembled for the Sinclair ZX81 up for sale and so started to bid. I got caught up in a bit of a bidding war but gave up when it got silly.
The book went for £44 in the end.
I was wondering if anyone had read this book and was it really worth that? Is it the de facto book on machine code for the zeddy?

Lardo
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
User avatar
zx81jens
Posts: 202
Joined: Sat May 10, 2008 8:26 am
Location: a Basement in Nienburg / Germany

Re: Assembly Language Assembled for the Sinclair ZX81

Post by zx81jens »

Hey Lardo!

Try this:

http://www.users.waitrose.com/~thunor/mmcoyzx81/

Greetings
Jens
eyerything will be okay in the end.
if it´s not okay, it´s not the end.

and: uıɐbɐ ʎɐqǝ uo pɹɐoqʎǝʞ ɐ ʎnq ɹǝʌǝ ɹǝʌǝu ןןıʍ ı
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Moggy »

@Lardo

Now that brings back memories. I gave Thurnor the heads up about the duff calculator routines for which he kindly gave me a mention at the end of chapter 17,the raising of powers is still the original convoluted authors routine though rather than the one byte instruction it should be. The original book was a bit error ridden and Thurnor weeded out the errors but as a learning device I found it a bit weak. Once you remove the chapters devoted to drawing a bloody draughts boards, the pages devoted to the instruction set and the ever so brief bits re the calculator a slim volume becomes even slimmer.

This book is rather more informative albeit one dedicated to the Z80 rather than the 81 itself but a good grounding in Z80 M/L nevertheless.

http://www.z80.info/zip/zaks_book.pdf


I also have said book you were bidding on and quite frankly you had a lucky escape is all I can say about it. :lol:
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Lardo Boffin »

zx81jens wrote: Sat Apr 08, 2017 7:43 pm Hey Lardo!

Try this:

http://www.users.waitrose.com/~thunor/mmcoyzx81/

Greetings
Jens
Thanks Jens - I have a hard copy of this one but given its lack of index being able to search the pages will be a bonus.
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Lardo Boffin »

Moggy wrote: Sat Apr 08, 2017 10:05 pm @Lardo

This book is rather more informative albeit one dedicated to the Z80 rather than the 81 itself but a good grounding in Z80 M/L nevertheless.

http://www.z80.info/zip/zaks_book.pdf


I also have said book you were bidding on and quite frankly you had a lucky escape is all I can say about it. :lol:
Thanks Moggy, or should I say tibbytab? I have a copy of the Rodnay Zaks book and am trying to work my way through it!

I am mostly looking at books specifically on Z80 on the zeddy so I can get my head around the memory map and zeddy specific gotchas such as not touching the IX / IY registers etc.

Lardo
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
Moggy
Posts: 3266
Joined: Wed Jun 18, 2008 2:00 pm

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Moggy »

Understood lardo.

If you really want that book you were bidding on I'm almost sure I've seen it on the web so will look where I thought I saw it, if not I'll get the old scanner dusted down and sort some thing out for you. :D

As for messing with the index registers Andy Rea knows a thing or two about that!! :ugeek:
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Lardo Boffin »

Moggy wrote: Sat Apr 08, 2017 10:39 pm Understood lardo.

If you really want that book you were bidding on I'm almost sure I've seen it on the web so will look where I thought I saw it, if not I'll get the old scanner dusted down and sort some thing out for you. :D

As for messing with the index registers Andy Rea knows a thing or two about that!! :ugeek:
Thanks Moggy. If the book is that poor don't worry about it!

Funnily enough I asked a question about said registers and it was Andy who replied with a solution!
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Assembly Language Assembled for the Sinclair ZX81

Post by 1024MAK »

Did I hear the phrase 'memory map'? Try these posts of mine :P

If you are after the details of the BASIC ROM, Geoff's site is what you need. Alas, last time I tried it, it was off-line :(
See this thread.
Luckily the Internet Archive has parts of his web site, the ZX81 ROM is here ;)

Also see
The Complete Timex TS1000 & Sinclair ZX81 ROM Disassembly - Book by Frank O'Hara and Ian Logan
Web version here ;-)

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
dr beep
Posts: 2076
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Assembly Language Assembled for the Sinclair ZX81

Post by dr beep »

Lardo Boffin wrote: Sat Apr 08, 2017 10:25 pm I am mostly looking at books specifically on Z80 on the zeddy so I can get my head around the memory map and zeddy specific gotchas such as not touching the IX / IY registers etc.
I have a fixed startbase for all programs.
Standard values for sysvar, 1 BASIC-line calling the machinecode and then just all available memory to my own use available.
I never worry about the memorymap. Just keep space for the sysvar and after that use what you need in whatever order you like. Even the screen can be located where you like it best. Best part of that is that you can built multiple screens and switch between them within a frame.

Golden tip: Registers best not to use: IX, IY and AF'
You can use IX for your own (hires)screenroutines. In a next game I will use bit 7 of IXh as an extra flag, but this needs a trick.
IY Is used as indexregister to sysvar. During intrupt you can use the register as long as you set it back at the end.
AF' is used to start intrupts. Wihin your own intrupt you can use it, but like IY you need to set it back.

The only limitations are the amount of memory, your imagination, problem solving possibilities and perseference
Lardo Boffin
Posts: 2169
Joined: Sat Nov 26, 2016 2:42 am

Re: Assembly Language Assembled for the Sinclair ZX81

Post by Lardo Boffin »

dr beep wrote: Sun Apr 09, 2017 11:20 am
Lardo Boffin wrote: Sat Apr 08, 2017 10:25 pm I am mostly looking at books specifically on Z80 on the zeddy so I can get my head around the memory map and zeddy specific gotchas such as not touching the IX / IY registers etc.
I never worry about the memorymap. Just keep space for the sysvar and after that use what you need in whatever order you like. Even the screen can be located where you like it best. Best part of that is that you can built multiple screens and switch between them within a frame.

Golden tip: Registers best not to use: IX, IY and AF'
You can use IX for your own (hires)screenroutines. In a next game I will use bit 7 of IXh as an extra flag, but this needs a trick.
IY Is used as indexregister to sysvar. During intrupt you can use the register as long as you set it back at the end.
AF' is used to start intrupts. Wihin your own intrupt you can use it, but like IY you need to set it back.

The only limitations are the amount of memory, your imagination, problem solving possibilities and perseference
Thanks Dr Beep! I have never used interrupt programming before - I have never had the need to. I will look into it although I'm not touching hi-res in my current project. Maybe the next one!

I was wondering about IY - it was set to &4000 the same start point as the sys vars and I considered this to be too much of a coincidence.

How do you switch between screens held in memory? Is it just a case of setting the location for D_FILE or is it way more complex than that? Just curious!

My major limiting factor is time. I get maybe 4 hours a week to write code which is not much when learning. :cry:

Lardo
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
Post Reply