Content deleted Content added
m →Sample code: rephrased "?" versus "PRINT" explanation to be technically accurate |
PEEK(-16384) or equivalent PEEK(49152), $C000, serves as an INKEY$ function; giving the ONERR GOTO bug-fix call to ROM |
||
Line 40:
== Trivia ==
{{trivia|date=November 2007}}
* Despite its heritage, Applesoft lacked commands common to non-6502 Microsoft BASIC interpreters, such as INSTR (which searched for a substring in a given string), PRINT USING (which formatted numbers with commas and currency signs according to a format string), and INKEY$ (which checked for a keypress without stopping the program as Applesoft's GET did), although a PEEK ___location did provide this functionality. It seems likely that memory constraints were at the root of these differences, as the Apple II ROM had only 10 kilobytes available for the interpreter, and the improved hi-res graphics support was clearly a higher priority. Microsoft's CLS command (for clearing the screen) was renamed HOME in Applesoft.
* There was a well-documented bug in Applesoft BASIC that could actually crash the interpreter if ONERR GOTO was in effect and numerous program errors occurred. Apple provided a short assembly-language routine which could be POKEd into RAM and CALLed to ameliorate the problem to an extent. Later it was discovered by an enterprising hacker that the required code was actually in the Applesoft ROM (though it was never executed) and could be called there instead: CALL -3288 or (equivalent) 62248.
* The initial release of Applesoft included a ROUND function that was non-[[monotonic]]. The "Applesoft II" release omits the ROUND function; the common idiom was INT(X + 0.5).
* Applesoft's garbage collector was notoriously slow (O(''n''²)). If a program had a large number of string variables, garbage collection, which occurred when the interpreter ran out of memory for a new string allocation, could seemingly lock up the computer for several minutes. Since users could not know when the computer was running low on string memory, these pauses seemed random and inexplicable. Though third parties provided some improvements, Apple did not truly fix the problem until [[Apple ProDOS|ProDOS]], which included a new garbage collector that did the same job in seconds as part of BASIC.SYSTEM.
|