×   Main Menu ALL The 8BS News Manuals (New menu) Links Worth a Look Tools Disc and Basic Webring Site Map 8BS Guestbook Old Guest Book Me The Barnsley Rovers   
8-Bit Software

The BBC and Master Computer Public Domain Library

8F12 RUN

Submitted by Steve Fewell

Description:

Call routine &9BA6 to check that the statement terminates correctly with a ':', '<cr>' or 'ELSE-token' character,
issuing 'Syntax error' if it doesn't.
Call routine &BBAC to clear the run-time variable memory (variable pointer table), set up the page &7 constants
&07F0-&07FF, and the Program Start, Stack Pointer, LOMEM and VARTOP information. It also clears the LISTO flag and
clears the REPEAT level (&24), FOR level (&26) and GOSUB level (&25) - ready for the execution of the program.

Set BASIC Text pointer A to PAGE (MSB byte from location &18, and LSB byte = #&00).
Jump to &8F97 to tokenise the statement at the Text Pointer A location (should have no affect, as it is already
tokenised) and then execute the statement (via routine &901E). As the Text Pointer A is not pointing to the BASIC
Command line (location &0700-&07FF), the next program line will be executed after the current line.

Disassembly for the RUN routine

8F12   032 166 155 20 A6 9B JSR &9BA6 Check end of Statement
8F15   032 172 187 20 AC BB JSR &BBAC Initialise Page 7 & reset Variable pointers, etc...
8F18   165 024 A5 18 LDA &18
8F1A   133 012 85 0C STA &0C
8F1C d 100 011 64 0B STZ &0B
8F1E w 128 119 80 77 BRA 119 --> &8F97 Tokenise and Execute command line

 


 Back to 8BS
Or