Submitted by Steve Fewell
Description:
Firstly, A & Y are pushed to the 6502 stack (to save their value)
Then the value in A is checked and the following operations are carried out depending
on its value (listed are the service type numbers, the definition of the service number
and the execution address for the service call):
&09 - *HELP instruction expansion (issued by MOS when user enters *HELP instruction) --> &804C
&04 - Unrecognised command (issued by MOS for unrecognised *-command) --> &8070
&02 - Relative Private workspace claim (issued by MOS after a [BREAK]) --> &8040
&27 - A Reset has occurred (issed by MOS on hard reset) --> &8040 (same as &02, above)
If A contains none of the above values then [&806A] Y & A are pulled from the 6502 stack
and X is set to the RAM copy of the currently selected paged ROM (from zero page memory location &F4),
which is the ROM number of this BASIC ROM. Then the service call is exited (RTS).
Following are descriptions of these 3 service call routines
Changes from BASIC IV:
The addition of a service address is completely new functionality that is not present in BASIC IV.
Additionally, BASIC IV did not have a TUBE version (e.g. HIBASIC) that specifically ran accross the TUBE.
802C |
H |
72 |
48 |
PHA |
802D |
|
170 |
AA |
TAX |
802E |
|
152 |
98 |
TYA |
802F |
H |
72 |
48 |
PHA |
8030 |
|
224 009 |
E0 09 |
CPX#&09 |
8032 |
|
240 024 |
F0 18 |
BEQ 24 --> &804C |
8034 |
|
224 004 |
E0 04 |
CPX#&04 |
8036 |
8 |
240 056 |
F0 38 |
BEQ 56 --> &8070 |
8038 |
|
224 002 |
E0 02 |
CPX#&02 |
803A |
|
240 004 |
F0 04 |
BEQ 4 --> &8040 |
803C |
' |
224 039 |
E0 27 |
CPX#&27 |
803E |
* |
208 042 |
D0 2A |
BNE 42 --> &806A |
|
169 187 |
A9 BB |
LDA#&BB |
|
8042 |
|
166 244 |
A6 F4 |
LDX &F4 |
8044 |
|
160 000 |
A0 00 |
LDY#&00 |
8046 |
|
032 244 255 |
20 F4 FF |
JSR &FFF4 OSBYTE |
8049 |
Lj |
076 106 128 |
4C 6A 80 |
JMP &806A |
|
177 242 |
B1 F2 |
"LDA (&F2),Y" |
|
804E |
|
201 013 |
C9 0D |
CMP#&0D |
8050 |
|
208 024 |
D0 18 |
BNE 24 --> &806A |
8052 |
|
032 231 255 |
20 E7 FF |
JSR &FFE7 OSNEWL |
8055 |
|
162 246 |
A2 F6 |
LDX#&F6 |
8057 |
|
189 019 127 |
BD 13 7F |
"LDA &7F13,X" |
805A |
|
208 002 |
D0 02 |
BNE 2 --> &805E |
805C |
|
169 032 |
A9 20 |
LDA#&20 |
805E |
|
032 227 255 |
20 E3 FF |
JSR &FFE3 OSASCI (Write Character) |
8061 |
|
232 |
E8 |
INX |
8062 |
|
208 243 |
D0 F3 |
BNE -13 --> &8057 |
8064 |
|
032 231 255 |
20 E7 FF |
JSR &FFE7 OSNEWL |
8067 |
|
032 216 128 |
20 D8 80 |
JSR &80D8 |
h |
104 |
68 |
PLA |
|
806B |
|
168 |
A8 |
TAY |
806C |
|
166 244 |
A6 F4 |
LDX &F4 |
806E |
h |
104 |
68 |
PLA |
806F |
` |
96 |
60 |
RTS |
|
177 242 |
B1 F2 |
"LDA (&F2),Y" |
|
8072 |
) |
041 223 |
29 DF |
AND#&DF |
8074 |
H |
201 072 |
C9 48 |
CMP#&48 |
8076 |
|
208 023 |
D0 17 |
BNE 23 --> &808F |
8078 |
|
200 |
C8 |
INY |
8079 |
@ |
169 064 |
A9 40 |
LDA#&40 |
807B |
|
004 244 |
04 F4 |
TSB &F4 |
807D |
|
177 242 |
B1 F2 |
"LDA (&F2),Y" |
807F |
|
200 |
C8 |
INY |
8080 |
. |
201 046 |
C9 2E |
CMP#&2E |
8082 |
$ |
240 036 |
F0 24 |
BEQ 36 --> &80A8 |
8084 |
) |
041 223 |
29 DF |
AND#&DF |
8086 |
I |
201 073 |
C9 49 |
CMP#&49 |
8088 |
|
240 005 |
F0 05 |
BEQ 5 --> &808F |
808A |
|
032 216 128 |
20 D8 80 |
JSR &80D8 |
808D |
|
136 |
88 |
DEY |
808E |
|
136 |
88 |
DEY |
808F |
|
162 251 |
A2 FB |
LDX#&FB |
8091 |
|
177 242 |
B1 F2 |
"LDA (&F2),Y" |
8093 |
. |
201 046 |
C9 2E |
CMP#&2E |
8095 |
|
240 017 |
F0 11 |
BEQ 17 --> &80A8 |
8097 |
) |
041 223 |
29 DF |
AND#&DF |
8099 |
|
221 014 127 |
DD 0E 7F |
"CMP &7F0E,X" |
809C |
|
208 201 |
D0 C9 |
BNE -55 --> &8067 |
809E |
|
200 |
C8 |
INY |
809F |
|
232 |
E8 |
INX |
80A0 |
|
208 239 |
D0 EF |
BNE -17 --> &8091 |
80A2 |
|
177 242 |
B1 F2 |
"LDA (&F2),Y" |
80A4 |
! |
201 033 |
C9 21 |
CMP#&21 |
80A6 |
|
176 191 |
B0 BF |
BCS -65 --> &8067 |
80A8 |
$ |
036 244 |
24 F4 |
BIT &F4 |
80AA |
P |
080 032 |
50 20 |
BVC 32 --> &80CC |
80AC |
f |
032 102 191 |
20 66 BF |
JSR &BF66 Detect if Tube is present |
80AF |
|
208 027 |
D0 1B |
BNE 27 --> &80CC |
80B1 |
|
032 216 128 |
20 D8 80 |
JSR &80D8 |
80B4 |
|
162 010 |
A2 0A |
LDX#&0A |
80B6 |
|
189 194 128 |
BD C2 80 |
"LDA &80C2,X" |
80B9 |
|
157 000 001 |
9D 00 01 |
"STA &0100,X" |
80BC |
|
202 |
CA |
DEX |
80BD |
|
016 247 |
10 F7 |
BPL -9 --> &80B6 |
80BF |
L |
076 000 001 |
4C 00 01 |
JMP &0100 |
80C2 |
|
0 |
0 |
BRK |
80C3 |
|
0 |
0 |
BRK |
80C4 |
No TUBE |
078 111 032 084 085 066 069 |
4E 6F 20 54 55 42 45 |
EQUS "No TUBE" |
80CB |
E |
000 |
00 |
BRK |
80CC |
|
165 244 |
A5 F4 |
LDA &F4 |
80CE |
I@ |
073 064 |
49 40 |
EOR#&40 |
80D0 |
|
170 |
AA |
TAX |
80D1 |
|
169 142 |
A9 8E |
LDA#&8E |
80D3 |
|
160 000 |
A0 00 |
LDY#&00 |
80D5 |
L |
076 244 255 |
4C F4 FF |
JMP &FFF4 OSBYTE |
@ |
169 064 |
A9 40 |
LDA#&40 |
|
80DA |
|
020 244 |
14 F4 |
TRB &F4 |
80DC |
` |
96 |
60 |
RTS |