Useful POKEs
Useful POKEs
I came across a list of useful POKEs and calls to teh ROM for the ZX81 in Sinclair Programs last night (not tested), and thought it may be worthwhile sharing the list with everyone, as not all have 20+ years experience of using the ZX81...
RAND USR 963 - clears the program area
RAND USR 3086 - scrolls the screen up one line
RAND USR 681 - in FAST mode, prevents the report code from being displayed at the end of a program
RAND USR 0 - clears the program area and RAMTOP
RAND USR 836 - loads a program and stops it if it is self-starting!
RAND USR 757 - In FAST mode, saves a program without a name
RAND USR 3292 - equivalent to STOP
RAND USR 3875 - equivalent to FAST
RAND USR 1476 - equivalent to EDIT
RAND USR 930 - equivalent to BREAK
RAND USR 2955 - equivalent to the , (comma) in a PRINT statement
POKE 16510,0 - makes the first program line uneditable
POKE 16389,68 - sets up a minimal display file for 16K users
RAND USR 963 - clears the program area
RAND USR 3086 - scrolls the screen up one line
RAND USR 681 - in FAST mode, prevents the report code from being displayed at the end of a program
RAND USR 0 - clears the program area and RAMTOP
RAND USR 836 - loads a program and stops it if it is self-starting!
RAND USR 757 - In FAST mode, saves a program without a name
RAND USR 3292 - equivalent to STOP
RAND USR 3875 - equivalent to FAST
RAND USR 1476 - equivalent to EDIT
RAND USR 930 - equivalent to BREAK
RAND USR 2955 - equivalent to the , (comma) in a PRINT statement
POKE 16510,0 - makes the first program line uneditable
POKE 16389,68 - sets up a minimal display file for 16K users
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
-
- Posts: 32
- Joined: Sat May 10, 2008 2:31 am
Re: Useful POKEs
Thanks for the useful pokes.
Re: Useful POKEs
If I remember this right,
for a RAND USR 836 you need to be in Fast mode
for a RAND USR 836 you need to be in Fast mode
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Useful POKEs
POKE 16510,0
I remember using that one to prevent people from removing REM statements proclaming my copyright to a listing
I remember using that one to prevent people from removing REM statements proclaming my copyright to a listing

Re: Useful POKEs
Yes, but by poking 1 the line number can easily be reset to 1 and the line can be deleted.angus wrote:POKE 16510,0
I remember using that one to prevent people from removing REM statements proclaming my copyright to a listing
Ab better way is to start editing a new program with line 1 and a copyright note:
1 REM COPYRIGHT ...
Then do a POKE 16509, 40
That will change the line number to "A280", which can neither be edited nor deleted.
And because that is a big line number, all further BASIC lines will be inserted before that line, so the lines moves up in memory and cannot be found easily (to POKE it back to a valid line number).
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
http://zx81.ddns.net/ZxTeaM
Re: Useful POKEs
POKE 16418,0
from within a program gives to 2 more lines at the bottom of the screen to be PRINTed AT (so the full screen 24x32 may be used by the program).
But set it back to the normal value 2, if you want to INPUT data (needs that 2 lines).
Siggi
from within a program gives to 2 more lines at the bottom of the screen to be PRINTed AT (so the full screen 24x32 may be used by the program).
But set it back to the normal value 2, if you want to INPUT data (needs that 2 lines).
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
http://zx81.ddns.net/ZxTeaM
Re: Useful POKEs
Is there anyway I can remove lines of BASIC whilst the BASIC program is running?
Thanks,
Shaun.
Thanks,
Shaun.
Re: Useful POKEs
Yes but not that easy. You have to switch to FAST mode and delete part of memory and move a memory block. Can be done in assembly only.
Re: Useful POKEs
Could this thread be a sticky please so I don't have to keep searching for it 
Thanks,
Shaun.

Thanks,
Shaun.
Re: Useful POKEs
This is a Line Number Construction Kit for ZX81 BASIC:
It changes the first line to a valid linenumber between 0000 and G383, e.g. F999. It was tested in the emulator ZCE. It's Public Domain.
Code: Select all
1 REM
1000 PRINT "LINE NUMBER CONSTRUCTION KIT"
1010 PRINT AT 21,0;"LINE NUMBER?"
1020 INPUT L$
1030 LET L=(CODE (L$)-28)*1E3+VAL (L$(2 TO ))
1040 CLS
1050 PRINT L$;"=";L
1055 PRINT
1060 LET H=INT (L/256)
1070 LET L=INT (L-256*H)
1080 PRINT "POKE 16509,";H;" INVALID" AND H>63
1090 PRINT "POKE 16510,";L
1095 PRINT
1100 PRINT "TO RESET:"
1110 PRINT "POKE 16509,0"
1120 PRINT "POKE 16510,1"
1130 PRINT
1140 IF H>63 THEN STOP
1150 POKE 16509,H
1160 POKE 16510,L
1170 LIST
Started w/ BASIC on ABC80 & ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://www.youtube.com/user/MOBiL4u/ https://twitter.com/mobluse/