Not sure where to post this, it has been a loooong time since I worked on an Apple ][+, I currently have 3 of them, but they are in need of repair, but I got them cheap. Anyway, you were mentioning on another post, the timing of basic, and if I remember correctly, a subroutine (i.e. GOSUB 210 ) is faster to access than a GOTO statement.
Also you can chain commands on a line to compact code somewhat. I seem to remember line length was 240 chars max.
FOR NEXT loops can be used to do repetitive things, and for some reason ( for me at least) at decrementing loop was faster ( FOR I=100 TO 1: STEP -1:NEXT)
You can remove the reference to the loop variable and it will still work, unlike some basics, which complain.
You can nest loops also, and use a single NEXT to refer, but you need to keep the order straight.
FOR I=1 TO 100
FOR J=1 TO 20
X=PEEK (-16336)
NEXT J,I
If the order is wrong, it will run, but you will get a 'NEXT WITHOUT FOR ERROR' when it is run
I'm not sure if this applies to Basic, but in machine language on most microcomputer architectures of the time, decrementing would set a flag when you reached zero. If you were counting up, you'd have to do a separate compare against the upper limit, which meant an extra instruction.
Another note of interest re AppleSloth, as we fondly called it.
If you can program in INTeger basic, it is faster, although machine code is as fast as you can go.
There were a few companies selling applesoft compilers that would turn a basic program into executable machine code.
One was called surprisingly, 'The Applesoft Compiler' or TASC.
I did some searching and found there is a 'c' compiler available as well
Comments are closed because this post is 6 years old.
A significant fraction of of my brain reflects the Beagle Bros media art.
Reminds me of the manual for my Commodore 64 5.25" floppy disk drive:
"Please read manual carefully, otherwise you will take trouble and get danger in your system."
Loved the Beagle Brothers art, utilities and clever hacks. I still have their Peek/Poke wall chart tucked away in the hall closet...
Beagle Bros were steampunk before steampunk was steampunk.
Not sure where to post this, it has been a loooong time since I worked on an Apple ][+, I currently have 3 of them, but they are in need of repair, but I got them cheap. Anyway, you were mentioning on another post, the timing of basic, and if I remember correctly, a subroutine (i.e. GOSUB 210 ) is faster to access than a GOTO statement.
Also you can chain commands on a line to compact code somewhat. I seem to remember line length was 240 chars max.
FOR NEXT loops can be used to do repetitive things, and for some reason ( for me at least) at decrementing loop was faster ( FOR I=100 TO 1: STEP -1:NEXT)
You can remove the reference to the loop variable and it will still work, unlike some basics, which complain.
You can nest loops also, and use a single NEXT to refer, but you need to keep the order straight.
FOR I=1 TO 100
FOR J=1 TO 20
X=PEEK (-16336)
NEXT J,I
If the order is wrong, it will run, but you will get a 'NEXT WITHOUT FOR ERROR' when it is run
This list might be helpful, it brings back memories !
http://appleiirevisited.azurewebsites.net/2017/01/29/apple-ii-peeks-pokes-and-calls/
I'm not sure if this applies to Basic, but in machine language on most microcomputer architectures of the time, decrementing would set a flag when you reached zero. If you were counting up, you'd have to do a separate compare against the upper limit, which meant an extra instruction.
Another note of interest re AppleSloth, as we fondly called it.
If you can program in INTeger basic, it is faster, although machine code is as fast as you can go.
There were a few companies selling applesoft compilers that would turn a basic program into executable machine code.
One was called surprisingly, 'The Applesoft Compiler' or TASC.
I did some searching and found there is a 'c' compiler available as well