Submitted by Steve Fewell
Description:
This routine has many entry points (depending on how the last statement finished and what needs to be done to tidy up
before the next statement can be executed. The entry points are listed between square brackets ([]).
Therefore, this routine may not necessarily be executed in the order described.
[&9073] Skip the rest of the line. This routine is called when a DATA keyword is found (as DATA statements are skipped
when reached and not executed (as the READ command controls how they are handled). It is also called when the DEF keyword
is found (as function and procedure definitions are not directly executed until they are called by an FN or PROC keyword).
This routine is also called when a REM keyword is found, to skip the rest of the line - as it is a comment line.
Additionally, this routine is also executed when a '*' command is found (the '*' command is first passed to the Operating
System OSCLI routine and then this routine skips the line - so that BASIC doesn't try to execute the '*' command.
The rest of the line is skipped as follows:
* Set A to #&0D (the end of line character - '<cr>').
* Set Y to the BASIC Text Pointer A offset (&0A) - 1.
* Keep incrementing Y and checking the character at BASIC Text pointer A (&0B-&0C) plus Y (offset) with the
character in A (the '<cr>' character) until the characters match.
* Call routine &9C80 to update the BASIC Text Pointer A address (to include the Y offset value) and to reset the offset
(&0A) to 1. (basically, this adds Y to the Text Pointer A address (&0B-&0C)).
[&9082] This routine checks whether the last character read (in A) is '<cr>', if it isn't then jump to &9073
to skip the rest of the line.
Now, we are at the end of the line (i.e. we have reached the '<cr>' character).
[&9086] If the BASIC Text pointer MSB address is #&07 then there are no more program lines to execute (as we were
executing a statement from the command line - and not from within a program), so jump to &904B to prompt for the next
command line input.
Set Y to #&01.
Load the next character (offset Y) from the BASIC text pointer A location.
If the character is negative (i.e. #&FF) then we have reached the end of the program, so jump to &904B to prompt
for the next command line input.
|
169 013 |
A9 0D |
LDA#&0D |
|
9075 |
|
164 010 |
A4 0A |
LDY &0A |
9077 |
|
136 |
88 |
DEY |
|
200 |
C8 |
INY |
|
9079 |
|
209 011 |
D1 0B |
"CMP (&0B),Y" |
907B |
|
208 251 |
D0 FB |
BNE -5 --> &9078 |
|
032 128 156 |
20 80 9C |
JSR &9C80 Update BASIC Text pointer A (Add offset value & then reset offset to 1) | |
9080 |
|
128 004 |
80 04 |
BRA 4 --> &9086 Process the next program line |
|
201 013 |
C9 0D |
CMP#&0D |
|
9084 |
|
208 237 |
D0 ED |
BNE -19 --> &9073 Skip the rest of the line and process the next program line |
|
165 012 |
A5 0C |
LDA &0C |
|
9088 |
|
201 007 |
C9 07 |
CMP#&07 |
908A |
|
240 191 |
F0 BF |
BEQ -65 --> &904B Read & execute command line input |
908C |
|
160 001 |
A0 01 |
LDY#&01 |
908E |
|
177 011 |
B1 0B |
"LDA (&0B),Y" |
9090 |
0 |
048 185 |
30 B9 |
BMI -71 --> &904B Read & execute command line input |
9092 |
|
166 032 |
A6 20 |
LDX &20 |
9094 |
|
240 010 |
F0 0A |
BEQ 10 --> &90A0 |
9096 |
+ |
133 043 |
85 2B |
STA &2B |
9098 |
|
200 |
C8 |
INY |
9099 |
|
177 011 |
B1 0B |
"LDA (&0B),Y" |
909B |
* |
133 042 |
85 2A |
STA &2A |
909D |
|
032 015 157 |
20 0F 9D |
JSR &9D0F Display current line number (IWA) on screen [if TRACE is on] |
|
160 004 |
A0 04 |
LDY#&04 |
|
90A2 |
|
132 010 |
84 0A |
STY &0A |
90A4 |
"," |
128 044 |
80 2C |
BRA 44 --> &90D2 |
|
169 003 |
A9 03 |
LDA#&03 |
|
90A8 |
( |
133 040 |
85 28 |
STA &28 |
90AA |
L |
076 221 137 |
4C DD 89 |
JMP &89DD '[' Begin Assembly |
L |
076 211 190 |
4C D3 BE |
JMP &BED3 EXT = | |
|
164 010 |
A4 0A |
LDY &0A |
|
90B2 |
|
136 |
88 |
DEY |
90B3 |
|
177 011 |
B1 0B |
"LDA (&0B),Y" |
90B5 |
* |
201 042 |
C9 2A |
CMP#&2A |
90B7 |
|
240 176 |
F0 B0 |
BEQ -80 --> &9069 '*'-Command |
90B9 |
[ |
201 091 |
C9 5B |
CMP#&5B |
90BB |
|
240 233 |
F0 E9 |
BEQ -23 --> &90A6 |
90BD |
|
201 162 |
C9 A2 |
CMP#&A2 |
90BF |
|
240 236 |
F0 EC |
BEQ -20 --> &90AD |
90C1 |
= |
201 061 |
C9 3D |
CMP#&3D |
90C3 |
^ |
240 094 |
F0 5E |
BEQ 94 --> &9123 '=' Return from Function Call (FN) |
|
198 010 |
C6 0A |
DEC &0A |
|
j |
032 106 156 |
20 6A 9C |
JSR &9C6A Check end of Statement | |
|
178 011 |
B2 0B |
LDA (&0B) |
|
90CC |
: |
201 058 |
C9 3A |
CMP#&3A |
90CE |
|
208 178 |
D0 B2 |
BNE -78 --> &9082 Skip the rest of the line (until '<cr>' found) & process the next program line |
|
164 010 |
A4 0A |
LDY &0A |
|
|
230 010 |
E6 0A |
INC &0A |
|
90D4 |
|
177 011 |
B1 0B |
"LDA (&0B),Y" |
90D6 |
|
201 032 |
C9 20 |
CMP#&20 |
90D8 |
|
240 246 |
F0 F6 |
BEQ -10 --> &90D0 |
90DA |
|
201 207 |
C9 CF |
CMP#&CF |
90DC |
|
144 012 |
90 0C |
BCC 12 --> &90EA |
|
10 |
0A |
ASL A |
|
90DF |
|
170 |
AA |
TAX |
90E0 |
� |
124 010 136 |
7C 0A 88 |
"JMP (&880A,X)" |
|
032 157 143 |
20 9D 8F |
JSR &8F9D Get next non-space character pointed to by Ptr A | |
90E6 |
|
201 198 |
C9 C6 |
CMP#&C6 |
90E8 |
|
176 244 |
B0 F4 |
BCS -12 --> &90DE |
|
166 011 |
A6 0B |
LDX &0B |
|
90EC |
|
134 025 |
86 19 |
STX &19 |
90EE |
|
166 012 |
A6 0C |
LDX &0C |
90F0 |
|
134 026 |
86 1A |
STX &1A |
90F2 |
|
032 214 153 |
20 D6 99 |
JSR &99D6 Evaluate variable/array name & return the address of the value |
90F5 |
|
208 027 |
D0 1B |
BNE 27 --> &9112 Create variable (LET) |
90F7 |
|
176 183 |
B0 B7 |
BCS -73 --> &90B0 |
90F9 |
|
134 027 |
86 1B |
STX &1B |
90FB |
J |
032 074 156 |
20 4A 9C |
JSR &9C4A Check for '=' |
90FE |
# |
032 035 153 |
20 23 99 |
JSR &9923 Create new variable name in variable pointer table |
9101 |
|
162 005 |
A2 05 |
LDX#&05 |
9103 |
"," |
228 044 |
E4 2C |
CPX &2C |
9105 |
|
208 001 |
D0 01 |
BNE 1 --> &9108 |
9107 |
|
232 |
E8 |
INX |
R |
032 082 153 |
20 52 99 |
JSR &9952 Allocate space for variable | |
910B |
|
198 010 |
C6 0A |
DEC &0A |
910D |
...LET keyword... |
|
032 146 143 |
20 92 8F |
JSR &8F92 Get next non-space character (PTR B) | |
9C4D |
= |
201 061 |
C9 3D |
CMP#&3D |
9C4F |
|
208 211 |
D0 D3 |
BNE -45 --> Mistake error |
9C51 |
` |
96 |
60 |
RTS |