in BASIC ROM:
|List of all BASIC keywords|
Type: Command General Programming-Syntax: LIST [[First Line]-[Last Line]]
The BASIC-Command LIST displays the BASIC program currently in memory: By default this listing is sent to the screen, but it can also be sent to e.g. a printer. Since program memory and the LISTing of its content is also used to retrieve and display the directory of a disk, LIST is also used to display such directories.
When LIST is using without any linenumbers, the entire program is be listing. During listing of a long program, the user may cancel the listing immediately by pressing <RUN/STOP>, or slow down the scrolling speed (e.g. to allow reading) by holding down the <CTRL> key.
By default, LIST displays its output on the screen, but the BASIC-Command CMD may be used to re-direct the listing to a printer, a file on a disk drive, or other peripheral devices through the use of the CMD command.
LIST is mainly used in direct mode, but may also be used as part of a BASIC program to make the program output a "dump" of itself during run-time. But due to the special internal handling of the LIST command inside BASIC ROM, the program always terminates (as if there was an END command) after executing the LIST command, leaving the user with the READY. prompt and cursor.
LIST 10 Only the line 10 of this program is listing on screen. LIST -10 All lines until line 10 of this program are listing on screen. LIST 10- All lines beginning with line 10 of this program are listing on screen. LIST 10-100 All lines beginning with line 10 and ending with line 100 are listing.
LIST is handled by ROM at 42562–42817/$A69C–A741: The part of this routine that prints out characters and tokens from the BASIC program text, is vectored through address 774–775/$306–$307. Part of creating BASIC extensions involves re-directing this and other vectors to "new" routines to facilitate the extra BASIC keywords.