Replacing numbers with a full stop.

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Replacing numbers with a full stop.

Post by Moggy »

Taken from a PDF I've been reading

Saving Memory on the Sinclair ZX81Sean A. Irvine Hamilton, New Zealand.


"Another oddity is that an isolated period (.) is a valid representation for 0 on the ZX81.Therefore, it was
possible to go through a program after it was written and compress out all but one of the visible digits in a number (and the last remaining digit could be replaced with . if desired)."

Is this possible and does it have any real world use programming wise?

PDF found here..

https://www.zx81.nl/dload/zx81-memory.pdf
User avatar
1024MAK
Posts: 5102
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Replacing numbers with a full stop.

Post by 1024MAK »

BDBB642F-975A-48E3-9F2B-7E7034222862.jpeg
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.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Replacing numbers with a full stop.

Post by Moggy »

Ha I see so when declaring variables for example such as,LET A=0,LET B=0 etc the six byte overhead that using a zero causes can be saved by using the full stop instead.
User avatar
1024MAK
Posts: 5102
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Replacing numbers with a full stop.

Post by 1024MAK »

Don’t know, I just wanted to try it and see if the syntax checker would allow it!

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.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Replacing numbers with a full stop.

Post by XavSnap »

No memory saved using a dot…
Use " LET A=PI-PI"...
dot.JPG
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Replacing numbers with a full stop.

Post by siggi »

Try
LET A = NOT PI
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
Post Reply