Hello, I'm Restarting ZX81 Programming After... 30 Years

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by IanB »

Thank you everyone for being so helpful. There seems to be a lot of expertise here! I think this is enough to get me started :)

Just one more question I'm not clear on, is it possible at all to detect the start of the second user programme execution block, that is (4) in my list, the set of lines below the screen?
User avatar
1024MAK
Posts: 5119
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by 1024MAK »

Welcome to the forum Ian!

:D :D :D

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.
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by IanB »

Thank you 1024MAK, I'm glad to be here!

And also my brain is starting to frazzle with Z80 machine code... :)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by PokeMon »

IanB wrote: Just one more question I'm not clear on, is it possible at all to detect the start of the second user programme execution block, that is (4) in my list, the set of lines below the screen?
Yes - you may read IX register for that purpose.
If it is $0281 it is indicating top margin and if it is $028F it is indicating bottom margin.
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by IanB »

Thanks, another question, is it safe to store stuff in the System Variable areas PRBUFF (the printer buffer) and MEMBOT (the calculator memory area) and under what conditions do these get cleared by the ROM? E.g. if I RET from the machine code to BASIC?
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by dr beep »

Take a look in the sources of the 1K hires games.

You can use the PRBUFF without problems. I suggest to start MC and NEVER return to BASIC.
Why? You can use the BASIC as part of your screen and clear it for use on screen. Also no tests needed for ROOM in Basic.
What would be the advantage of BASIC over a MC-routune?

http://sinclairzxworld.com/viewtopic.ph ... ces#p16917
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by PokeMon »

Well - I like your 1k programs, dr.beep but in fact creating those programs is more or less a personal passion.
This is not always the best way for beginners (or retired programmers :mrgreen: ).

I like the coexsistance of BASIC and Assembler more - both can benefit from each other.
Assembler is fast and BASIC is more powerful in functionality.
And only a few enthusiasts really work with Zeddy without any additional memory. 16k is the most common.

To answer your question - you may use the printer buffer as long as you don't print and as long as no other application has the same idea.
It's not used from the normal BASIC I think (not 100% sure).
I would avoid MEMBOT as this is used from BASIC routines.

You may use the ZX-IDE as development tool when developing under WIN.
viewtopic.php?f=6&t=1064

It does also support the usage of the EightyOne Emulator which are both together a winning team in my eyes.
It is very easy to mix BASIC and Assembly commands in one file - can see the ZX81DEMO.ASM and the tutorial thread.
Changes in your program can be tested automatically with pressing F8 in the code editor which starts or restarts the EightyOne with the actually compiled program (when autoload is switched on in the emulator).
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by dr beep »

PokeMon wrote:Well - I like your 1k programs, dr.beep but in fact creating those programs is more or less a personal passion.
This is not always the best way for beginners (or retired programmers :mrgreen: ).


I like the coexsistance of BASIC and Assembler more - both can benefit from each other.
Assembler is fast and BASIC is more powerful in functionality.
And only a few enthusiasts really work with Zeddy without any additional memory. 16k is the most common.
True, but in 1K the use of MEMBOT and BASIC will likely cost more than the routine in MC.
When coding in 16K I would say, use both for the simpliest use, but in 1K you will need all the space available.
To answer your question - you may use the printer buffer as long as you don't print and as long as no other application has the same idea.
It's not used from the normal BASIC I think (not 100% sure).
I would avoid MEMBOT as this is used from BASIC routines.

You may use the ZX-IDE as development tool when developing under WIN.
viewtopic.php?f=6&t=1064

It does also support the usage of the EightyOne Emulator which are both together a winning team in my eyes.
It is very easy to mix BASIC and Assembly commands in one file - can see the ZX81DEMO.ASM and the tutorial thread.
Changes in your program can be tested automatically with pressing F8 in the code editor which starts or restarts the EightyOne with the actually compiled program (when autoload is switched on in the emulator).
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by IanB »

I am looking at using PRBUFF and MEMBOT (and the two more unused bytes) because I see there 65 lovely bytes that can store program data, "sprite" data etc, for "free" and which are loaded in by the LOAD command, that's why I'm interested in what circumstances might erase or corrupt their contents. For instance, I am not sure (despite looking through the ROM dissassembly) whether the completion of the LOAD routine will do so. I don't want to use BASIC at all, but somehow the program must be loaded in on a standard ZX81, which is performed by part of the BASIC system.

I am writing for the 1K standard machine because I am interested in the challenge of what could be achieved with it (meaning, what could have been achieved back in 1981, compared to those crummy official Sinclair software tapes haha). Also, any 1K program by definition must be short. A 16k must be a big impressive program to be worth doing, and that's a greater commitment of time and effort. I see some fabulous 16k programs here on this forum and I don't have the time to commit to competing with that standard :)

It is a nice challenge here in 2015 to take a machine that even at the time was considered too little memory to do anything useful, and prove otherwise :) There is obviously no "rational" reason for ZX81 software of any kind in this day and age. It is just something I want to do as a personal thing.

And yes, I am using ZX-IDE and EightyOne :)
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Hello, I'm Restarting ZX81 Programming After... 30 Years

Post by dr beep »

After loading you can use the first 30 addresses from #4000 in MC without problems.
Post Reply