Except for the very earliest versions of basic, LET was rarely used, but the LET keyword was not always optional. Early BASIC interpreters required it; however, for most versions that came out for the PC (including Microsoft BASIC), the use of LET was optional.
Later standards in BASIC often required that the keyword be supported, but since there was no ...
Managing memory on an Apple II using Applesoft BASIC can be quite complicated, especially for large programs.
A general map of Apple II memory at power-up looks like this:
$E000-FFFF - Monitor ROM / Extended RAM 8 / 8 kB
$D000-DFFF - BASIC ROM / RAM bank 1 & 2 4 / 4 / 4 kB
$C800-CFFF - Shared slot ROM memory 2 kB
$C100-C7FF - Permanent ...
The Apple II has an input buffer separate from the screen, with a maximum capacity of 256 characters. Typing a printable character adds it to the buffer and the screen. The left-arrow button removes a character from the input buffer and moves the cursor left. The right arrow adds the character at the cursor position to the input buffer and moves the ...
This is an AppleSoft issue where it puts spaces either side of a token.
PET/CBM BASIC (based off the same code base) doesn't do this.
Tokenising ignores spaces, this means it can be difficult on the PET to see some of the problems that the tokeniser can cause.
For example LET AFOR=ONER gets parsed as LET A FOR = ON ER
Which is very difficult to see on a ...
I can only answer to the first question: the LET statement was actually used in 48K Sinclair BASIC, in which due to the way commands are entered, a keyword is needed before an identifier can be typed, so LET was needed in order to write a variable assignment (although there were unofficial patches to the ROM that eliminated that requirement).
In fact, and ...
The Wikipedia entry is a bit jumbled, ambiguous, and in some cases wrong.
Perhaps it makes more sense to list changes by Apple II model, as documented by the fantastic Apple II History site. (The book has even more detail.)
Apple II (1977)
APPLESOFT I, based on Microsoft 6502 BASIC version 1.1
Documented in the November 1977 "Blue Book"
Available on tape
In order for the drawing commands to work, they need to know what graphics page to use. Since HGR or HGR2 was not used, this setting (address $00E6) is left undefined, and is at the default boot-time value of zero.
So when HPLOT is used in this manner, it draws on "graphics page zero" from $0000-1FFF, and writes a string of bytes across the zero page and ...
Here is a program I wrote several years ago in AppleSoft for the fun of it. What it simply does is disassemble itself from the tokenized storage into a listing. If you run it, it will look the same as if you did a LIST command.
In general, this gives you all the rules of AppleSoft formatting but in the form of a program :-)
0 REM ** DISASSEMBLE MYSELF
In this case, to "toggle" the speaker means to move it from one position to the other. To make a sound, you repeatedly toggle the speaker (by poking that address) at a particular speed to make a sound of a particular frequency.
There is no way to turn off this functionality using software. The easiest way is to pull the jumper connecting the speaker to the ...
The paddles and joysticks on the Apple work by charging a capacity through a variable resistance (potentiometer). For the first joystick, the X-axis corresponds to paddle 0, and the Y-axis to paddle 1, and similarly for the second joystick.
Accessing address $C070 discharges all capacities, so they can now charge with a speed that is determined by the ...
In Applesoft BASIC, the parser recognizes reserved words greedily, but spaces outside tokens or reserved words are ignored. Variable names may consist of any sequence of letters or numbers provided they start with a letter and do not contain any reserved words. Because the code for listing programs adds spaces before and after recognized tokens, typing a ...
Though supercat points out the built-in way of editing BASIC programs on the screen (well, machine language as well if you were doing it via the monitor and mini-assembler), there are better tools for this. Specifically, I was a big fan of GPLE from Beagle Bros. back in the day.
The main problem that you run into with the screen editing method is that the ...
Yes. Replacing NEXT I with NEXT will also help.
One way to evaluate this is to throw a speaker click (PEEK -16336) into the loop and listen. The faster the loop, the higher the pitch. (Then try it with SP=-16336 outside the loop and PEEK SP in the loop, and note the effect that has...)
Monte Davidoff's floating point routines for early Microsoft BASIC used Chebyshev Modified Taylor series for EXP(x). There's a very helpful disassembly of the TRS-80 MC-10 ROM here: http://www.roust-it.dk/coco/mc10/romlist.txt. It's 6800 assembly, and the whole commented routine (using the same constants) is:
TBLF59B FCB $81,$38,$AA,$3B,$29 ;1.44269504 (...
The AppleSoft BASIC Wikipedia page has quite a bit of info on this:
Not really a feature, but the RAM footprint changed between the 1 & 2.
AppleSoft I - 8.5 kb
AppleSoft II - 10 kb
AppleSoft I had these features over the "Integer BASIC" (which Woz had written):
Atomic strings: A string is no longer an array of characters (as in Integer BASIC and ...
This is the result of the way AppleSoft "parses" programs. From the behavior you described, I can infer that at a high level, AppleSoft executes commands in two steps:
Evaluate arguments to the command (if any)
"sagdgg" has no arguments so step 1 is skipped, then in step 2 AppleSoft discovers that there is no such command as "sagdgg" and ...
ZP Location 216 ($D8) holds the ONERR Flag(s) it is non-zero whenever an ONERR target is set. To reset just poke zero here. This is by the way also the recomended method to start any error handling so an Error within the errorhandler will not cause any deadlock.
So your Programm might look like this:
10 ONERR GOTO 100
20 POKE 0, 400 : REM INVALID VALUE ...
10 input "some question?"; name$
Will be reformatted as:
10 INPUT "some question?" ; NAME$
That's not quite right (confirmed just now with an emulator). It will be reformatted as:
10 INPUT "some question?";NAME$
i.e. there are no spaces before and after the semicolon.
You can see what the formatting algorithm looks like in C++ in this ...
What are the rules for Applesoft BASIC formatting for code?
The most basic thein to know is that there is no source code in the sense of plain text files. Only the tokenized basic lines. When listing a programm. The tokens get converted back to their (uppercase) keywords with spaces being added after each.
This even adds some quirks when using screen ...
It’s been a while but...
MS BASIC used “ON ERROR GOTO” as opposed to “ONERR GOTO”, and using a line number of 0 outside of the error handling code reset it to the non-trapped default behavior.
In AppleSoft BASIC, you had to POKE 216,0 to reset to the default handler.
I will answer different question which is assumed by the original question; I am the author of the textbook in informatics, and think answering this way would be appropriate.
It is not that BASIC was great language to program, or people were just writing great books in the past, but now having difficulties with that. Consider the following:
BASIC was one ...
Summary of Dale's excellent response: Your Applesoft program has grown beyond memory location $4000, which puts it into the Hi-res page-2 memory area. Using the 'hgr2' command writes zeroes in that portion of memory, effectively stomping over part of your program.
On a wider note, old 8-bit machines (and beyond) tended to have rather complicated memory maps,...
When I started programming, there was only BASIC and GW BASIC followed. In those days you had to plan and reserve your memory, because there wasn't not much. LET and DIM did that trick. LET assigned memory to a variable and with DIM you had the option to define how much memory.
There was a lot of material quoted VERBATIM from the Wikipedia article that was "a bit jumbled, ambiguous, and in some cases wrong". I might ask what elements of the article these terms apply to.
Judging from the respective Applesoft I and II "blue books", it's not really possible to assert with certainty that the print-space function SPC() was added with ...