Tricks in BASIC
-
- Posts: 1
- Joined: Sat Jul 01, 2017 1:52 am
Re: Tricks in BASIC
I have an article describing a lot of these memory saving techniques and their history.
See: https://mega.nz/#!ioVzgDLa!Vmb4uS9c4Ivz ... wETip0tSp8
See: https://mega.nz/#!ioVzgDLa!Vmb4uS9c4Ivz ... wETip0tSp8
Re: Tricks in BASIC
Welcome to the forums - that is quite an interesting short article - I have uploaded it here to make it easier to accesssarchmageirvine wrote: ↑Sat Jul 01, 2017 1:55 am I have an article describing a lot of these memory saving techniques and their history.
See: https://mega.nz/#!ioVzgDLa!Vmb4uS9c4Ivz ... wETip0tSp8
- Attachments
-
- zx81-memory.pdf
- (104.14 KiB) Downloaded 1622 times
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
Re: Tricks in BASIC
Type this:
in direct mode, and then:
Do not try RUNning the listing, instead type:
As you will see, the file will save everything including the variable stack. So that means - if you are careful - you may type in your variables in direct mode and use them in your program. It also means that if someone breaks your program to hack it, and types RUN, the var stack will be wiped.
Regards,
Shaun
Code: Select all
LET A$="DONKEYSOFT"
Code: Select all
10 PRINT A$;" ";
20 GOTO 10
9998 SAVE "D"
9999 GOTO 10
Code: Select all
GOTO 9998
Regards,
Shaun
Re: Tricks in BASIC
I haven't thought of a practical use for it yet, but this is possible:
So you're re-using I in place of the start and end of the loop counter, and declaring I as the scalar value for the FOR/NEXT loop.
Regards,
Shaun.
Code: Select all
10 LET I=CODE "4"
20 FOR I=I/I TO I
30 PRINT I,;
40 NEXT I
Regards,
Shaun.
Re: Tricks in BASIC
Hi
I've not programmed anything in 30 years and am really struggling with many things.
This caught my eye while I was reading a few threads earlier this evening and I wonder if anyone could post an explanation of line 20.
The rest is simple enough to follow and I think I kind of somewhat get it, but not totally, so please assume I know nothing.
10 LET A$=" HELLO USER. THIS IS THE BEST COMPUTER IN THE WORLD. THE SINCLAIR ZX81 "
20 LET A$=A$(2 TO )+A$(1)
30 PRINT AT 10,1;A$(1 TO 30)
40 GOTO 20
Also, if this is covered in the SINCLAIR BASIC manual and anyone knows what page it's on, please let me know that too.
Thanks in advance to anyone that might respond.
I've not programmed anything in 30 years and am really struggling with many things.
This caught my eye while I was reading a few threads earlier this evening and I wonder if anyone could post an explanation of line 20.
The rest is simple enough to follow and I think I kind of somewhat get it, but not totally, so please assume I know nothing.
10 LET A$=" HELLO USER. THIS IS THE BEST COMPUTER IN THE WORLD. THE SINCLAIR ZX81 "
20 LET A$=A$(2 TO )+A$(1)
30 PRINT AT 10,1;A$(1 TO 30)
40 GOTO 20
Also, if this is covered in the SINCLAIR BASIC manual and anyone knows what page it's on, please let me know that too.
Thanks in advance to anyone that might respond.
Re: Tricks in BASIC
Must have been extra dozey earlier. I get it now.
@The little basic program is a nice way to achieve a simple text crawl:)
@The little basic program is a nice way to achieve a simple text crawl:)
Re: Tricks in BASIC
Hi jjh
Well you did not give us much time to respond.
Glad you sorted it out.
Sinclair Basic is a little different to others because of the usage of the keyword TO and the omitted parameters.
Kind regards Paul
Well you did not give us much time to respond.

Glad you sorted it out.
Sinclair Basic is a little different to others because of the usage of the keyword TO and the omitted parameters.
Kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Tricks in BASIC
Hi Paul
Thanks for checking it out.
Think I was just super tired last night after work.
It's a great forum/resource going on here that I only stumbled upon just over a week ago.
Lot's of really friendly, passionate it seems like and quick too offer help too.
Cheers!
Thanks for checking it out.
Think I was just super tired last night after work.
It's a great forum/resource going on here that I only stumbled upon just over a week ago.
Lot's of really friendly, passionate it seems like and quick too offer help too.
Cheers!
Re: Tricks in BASIC
Here's a scrolly text in a GOTO-less state:
It looks like the lack of a ZX-Next arriving has meant that I'm going to be making more ZX81 warez, so apologies in advance for more of my basic carp.
And Happy New Year guys!
Regards,
Shaun.
Code: Select all
1 LET X=SGN PI
2 LET Y=INT (PI*10)
3 FOR I=. TO SGN PI STEP .
4 PRINT AT .,.;" ... SCROLLY DEMO BY DONKEYSOFT MMXX ... HELLO TO ALL ZX-FANZ OUT THERE ... "(X TO X+Y)
5 LET X=X+SGN PI
6 IF X>VAL "106" THEN LET X=SGN PI
7 LET I=I+LEN INKEY$
8 NEXT I
And Happy New Year guys!
Regards,
Shaun.
Re: Tricks in BASIC
Hi,
The dot character equal a "0" integer and don't save memory. (8 bytes)
Anyway, it a good code!

The dot character equal a "0" integer and don't save memory. (8 bytes)
Anyway, it a good code!

Xavier ...on the Facebook groupe : "Zx81 France"(fr)