Assembly Language Assembled for the Sinclair ZX81

General Chit Chat about Sinclair Computers and their Clones
dr beep
Posts: 2060
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: Sun Apr 09, 2017 1:32 pm
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!
You can only use the intrupt from IX, not like ZX Spectrum set IM2
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.
Index registers can read a base-address with displacement, so IY can read IY+displacement, even negative.

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
Yes, just set another location in DFILE where a second (or more) screens are defined.
Post Reply