39

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 ...


29

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 ...


19

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 ...


18

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 ...


16

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 ...


15

The answers can be found in Apple's early "Blue Books". For more info see my answer here. Applesoft I on tape used $2A00 APPLESOFT I, based on Microsoft 6502 BASIC version 1.1 Documented in the November 1977 "Blue Book" Available on tape Loaded into memory at $800-$29FF (8.5k) Program and variables at $2A00 up (* See note below) Applesoft II used $3000 ...


13

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 ...


12

You can find the hi-res drawing code in an Applesoft disassembly. HPLOT starts at $F6FE. The ROM code is optimized for size, and parts are tricky to sort out. If you want something a bit more straightforward, you can find Applesoft-ish line drawing in fdraw. Some commentary on how Applesoft's line drawing code sets bits on the hi-res screen can be found ...


11

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 ...


10

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 1 ...


10

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 ...


9

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 ...


8

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...)


8

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 ...


8

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 ...


7

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 (...


5

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 ...


5

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) Execute command "sagdgg" has no arguments so step 1 is skipped, then in step 2 AppleSoft discovers that there is no such command as "sagdgg" and ...


5

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 ...


5

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 ...


4

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 ...


4

Not a book but a (relatively) current website, with lesson plans, in AppleSoft BASIC: 20 lessons to teach your 12-year old how to start programming


3

Yes Handling line end and a new lines start does take more time for the interpreter than skiping a colon.


3

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.


3

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 ...


2

The routines are documented in the Programmers Aid #1 manual https://archive.org/details/programmers-aid-1/page/n81 These are basically the same as the ones in the Applesoft ROM. They might use different zero page locations and won't handle floating point numbers but they are the same algorithms.


2

While you didn't explicitly mention the IIe, the following memory map information was taken directly from Inside the Apple IIe (1985) by Gary B. Little ISBN 0-89303-551-3: Page 47/48 $0000-$00FF. This is the 6502 zero page and it is used extensively by all parts of the lie's operating system, including the system monitor (see Chapter 3), the Applesoft ...


2

You can infer/prove/verify the start of Applesoft program memory by doing the following experiment... First we can look at the memory beginning at $0800 ] NEW ] CALL -151 * 0800L 0800- 00 BRK 0801- 00 BRK 0802- 00 BRK 0803 etc... Then we can enter a line of BASIC code and re-examine the same memory: RESET ] 10 PRINT "NEAT" ] CALL -151 * 0800L 0800- 00 ...


1

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,...


1

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 ...


Only top voted, non community-wiki answers of a minimum length are eligible