ZX81 Program query.

Frequently Asked Questions about the Sinclair ZX81
Forum rules
This is designed to be a simple set of questions and answers - please no general chit chat in here - keep it focused to help new users!
Post Reply
spilldig
Posts: 12
Joined: Fri Oct 08, 2010 8:20 pm

ZX81 Program query.

Post by spilldig »

Don't know if anyone can help on this one ?
I am trying to write the first part of a programme which starts
0 rem etc etc etc val print etc etc etc
The problem being that the line just carries on but the print commands only normally come on at the start of a newline,so how do they get the print commands on part way through one line ?

Any help would be gratefully appreciated.
zx80nut
Posts: 108
Joined: Mon May 23, 2011 2:10 pm
Location: A bit north of Cardiff, Wales.
Contact:

Re: ZX81 Program query.

Post by zx80nut »

Hi.
What you are seeing is "embeded" machine code that has been entered into a program via a loader, and not using the keyboard.

Normally, when a program is entered you create the first line such as
1 REM 0000000000000000000000

Then, the program (say, in a magazine) would then have a loader routine which is run to poke the machine code values into this REM statement.
When listed, the BASIC interpreter sees the control characters, some of which are BASIC reserved words and converts the poked code to a BASIC keyword, which is meaningless to read.

So, you don't enter those keywords directly, but poke in the values that are listed elsewhere.
If you are just looking at an existing listing after the pokes have taken place, then it is not possible to directly type it back in as you see it. You will need to poke the bytes as originally done.

Regards.

Grant.
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: ZX81 Program query.

Post by RWAP »

Yes - Grant is correct here - if you don't have the machine code loader, then you are lost, as various characters will not display correctly in the REMark statement either, such as CHR$(67) to CHR$(111) so ther is no way of knowing what the original byte value was.
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: ZX81 Program query.

Post by siggi »

To get the keyword "PRINT" somewhere in the middle of a REM line, you could also enter first the keyword THEN (SHIFT 3). After the keyword "THEN" the keyword "PRINT" could be entered just like at the beginning of a line. Then go back to the keyword THEN, delete it, and you have what you want ...

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: ZX81 Program query.

Post by RWAP »

Hee hee - yes, that would work, but what about the unprintable characters? It all depends what the poster is trying to achieve :D
spilldig
Posts: 12
Joined: Fri Oct 08, 2010 8:20 pm

Re: ZX81 Program query.

Post by spilldig »

Thank's to you all for the replies to this one.
I will have a look to see if a machine code loader is in there first.
Post Reply