-
Notifications
You must be signed in to change notification settings - Fork 78
/
kernal_sta.txt
297 lines (218 loc) · 10.8 KB
/
kernal_sta.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
- C64 KERNAL API (STA)
-
- Joe Forster/STA:
- Commodore 64 standard KERNAL functions
- https://sta.c64.org/cbm64krnfunc.html
-
- Corrections (typos as well as content), translations etc.
- welcome at: https://github.com/mist64/c64ref
-
----------------------------------------------
-
# This plain text file is formatted so that it can be automatically
# parsed in order to create cross-references etc.
# * Lines starting with "-" is top-level information. The first line
# is the title. Lines starting with "--" are separators.
# * Lines starting with "#" are internal comments.
# * Hex addresses start at column 0.
# * Symbols start at column 7.
# * The description starts at column 15.
# * All lines of the description until the first blank line are
# combined into the heading.
# * The remaining text is in MarkDown format.
# The encoding is UTF-8.
$FF81 SCINIT Initialize VIC; restore default input/output to keyboard/screen; clear screen; set PAL/NTSC switch and interrupt timer.
Input: –
Output: –
Used registers: A, X, Y.
Real address: $FF5B.
$FF84 IOINIT Initialize CIA's, SID volume; setup memory configuration; set and start interrupt timer.
Input: –
Output: –
Used registers: A, X.
Real address: $FDA3.
$FF87 RAMTAS Clear memory addresses $0002-$0101 and $0200-$03FF; run memory test and set start and end address of BASIC work area accordingly; set screen memory to $0400 and datasette buffer to $033C.
Input: –
Output: –
Used registers: A, X, Y.
Real address: $FD50.
$FF8A RESTOR Fill vector table at memory addresses $0314-$0333 with default values.
Input: –
Output: –
Used registers: –
Real address: $FD15.
$FF8D VECTOR Copy vector table at memory addresses $0314-$0333 from or into user table.
Input: Carry: 0 = Copy user table into vector table, 1 = Copy vector table into user table; X/Y = Pointer to user table.
Output: –
Used registers: A, Y.
Real address: $FD1A.
$FF90 SETMSG Set system error display switch at memory address $009D.
Input: A = Switch value.
Output: –
Used registers: –
Real address: $FE18.
$FF93 LSTNSA Send LISTEN secondary address to serial bus. (Must call LISTEN beforehands.)
Input: A = Secondary address.
Output: –
Used registers: A.
Real address: $EDB9.
$FF96 TALKSA Send TALK secondary address to serial bus. (Must call TALK beforehands.)
Input: A = Secondary address.
Output: –
Used registers: A.
Real address: $EDC7.
$FF99 MEMBOT Save or restore start address of BASIC work area.
Input: Carry: 0 = Restore from input, 1 = Save to output; X/Y = Address (if Carry = 0).
Output: X/Y = Address (if Carry = 1).
Used registers: X, Y.
Real address: $FE25.
$FF9C MEMTOP Save or restore end address of BASIC work area.
Input: Carry: 0 = Restore from input, 1 = Save to output; X/Y = Address (if Carry = 0).
Output: X/Y = Address (if Carry = 1).
Used registers: X, Y.
Real address: $FE34.
$FF9F SCNKEY Query keyboard; put current matrix code into memory address $00CB, current status of shift keys into memory address $028D and PETSCII code into keyboard buffer.
Input: –
Output: –
Used registers: A, X, Y.
Real address: $EA87.
$FFA2 SETTMO Unknown. (Set serial bus timeout.)
Input: A = Timeout value.
Output: –
Used registers: –
Real address: $FE21.
$FFA5 IECIN Read byte from serial bus. (Must call TALK and TALKSA beforehands.)
Input: –
Output: A = Byte read.
Used registers: A.
Real address: $EE13.
$FFA8 IECOUT Write byte to serial bus. (Must call LISTEN and LSTNSA beforehands.)
Input: A = Byte to write.
Output: –
Used registers: –
Real address: $EDDD.
$FFAB UNTALK Send UNTALK command to serial bus.
Input: –
Output: –
Used registers: A.
Real address: $EDEF.
$FFAE UNLSTN Send UNLISTEN command to serial bus.
Input: –
Output: –
Used registers: A.
Real address: $EDFE.
$FFB1 LISTEN Send LISTEN command to serial bus.
Input: A = Device number.
Output: –
Used registers: A.
Real address: $ED0C.
$FFB4 TALK Send TALK command to serial bus.
Input: A = Device number.
Output: –
Used registers: A.
Real address: $ED09.
$FFB7 READST Fetch status of current input/output device, value of ST variable. (For RS232, status is cleared.)
Input: –
Output: A = Device status.
Used registers: A.
Real address: $FE07.
$FFBA SETLFS Set file parameters.
Input: A = Logical number; X = Device number; Y = Secondary address.
Output: –
Used registers: –
Real address: $FE00.
$FFBD SETNAM Set file name parameters.
Input: A = File name length; X/Y = Pointer to file name.
Output: –
Used registers: –
Real address: $FDF9.
$FFC0 OPEN Open file. (Must call SETLFS and SETNAM beforehands.)
Input: –
Output: –
Used registers: A, X, Y.
Real address: ($031A), $F34A.
$FFC3 CLOSE Close file.
Input: A = Logical number.
Output: –
Used registers: A, X, Y.
Real address: ($031C), $F291.
$FFC6 CHKIN Define file as default input. (Must call OPEN beforehands.)
Input: X = Logical number.
Output: –
Used registers: A, X.
Real address: ($031E), $F20E.
$FFC9 CHKOUT Define file as default output. (Must call OPEN beforehands.)
Input: X = Logical number.
Output: –
Used registers: A, X.
Real address: ($0320), $F250.
$FFCC CLRCHN Close default input/output files (for serial bus, send UNTALK and/or UNLISTEN); restore default input/output to keyboard/screen.
Input: –
Output: –
Used registers: A, X.
Real address: ($0322), $F333.
$FFCF CHRIN Read byte from default input (for keyboard, read a line from the screen). (If not keyboard, must call OPEN and CHKIN beforehands.)
Input: –
Output: A = Byte read.
Used registers: A, Y.
Real address: ($0324), $F157.
$FFD2 CHROUT Write byte to default output. (If not screen, must call OPEN and CHKOUT beforehands.)
Input: A = Byte to write.
Output: –
Used registers: –
Real address: ($0326), $F1CA.
$FFD5 LOAD Load or verify file. (Must call SETLFS and SETNAM beforehands.)
Input: A: 0 = Load, 1-255 = Verify; X/Y = Load address (if secondary address = 0).
Output: Carry: 0 = No errors, 1 = Error; A = KERNAL error code (if Carry = 1); X/Y = Address of last byte loaded/verified (if Carry = 0).
Used registers: A, X, Y.
Real address: $F49E.
$FFD8 SAVE Save file. (Must call SETLFS and SETNAM beforehands.)
Input: A = Address of zero page register holding start address of memory area to save; X/Y = End address of memory area plus 1.
Output: Carry: 0 = No errors, 1 = Error; A = KERNAL error code (if Carry = 1).
Used registers: A, X, Y.
Real address: $F5DD.
$FFDB SETTIM Set Time of Day, at memory address $00A0-$00A2.
Input: A/X/Y = New TOD value.
Output: –
Used registers: –
Real address: $F6E4.
$FFDE RDTIM read Time of Day, at memory address $00A0-$00A2.
Input: –
Output: A/X/Y = Current TOD value.
Used registers: A, X, Y.
Real address: $F6DD.
$FFE1 STOP Query Stop key indicator, at memory address $0091; if pressed, call CLRCHN and clear keyboard buffer.
Input: –
Output: Zero: 0 = Not pressed, 1 = Pressed; Carry: 1 = Pressed.
Used registers: A, X.
Real address: ($0328), $F6ED.
$FFE4 GETIN Read byte from default input. (If not keyboard, must call OPEN and CHKIN beforehands.)
Input: –
Output: A = Byte read.
Used registers: A, X, Y.
Real address: ($032A), $F13E.
$FFE7 CLALL Clear file table; call CLRCHN.
Input: –
Output: –
Used registers: A, X.
Real address: ($032C), $F32F.
$FFEA UDTIM Update Time of Day, at memory address $00A0-$00A2, and Stop key indicator, at memory address $0091.
Input: –
Output: –
Used registers: A, X.
Real address: $F69B.
$FFED SCREEN Fetch number of screen rows and columns.
Input: –
Output: X = Number of columns (40); Y = Number of rows (25).
Used registers: X, Y.
Real address: $E505.
$FFF0 PLOT Save or restore cursor position.
Input: Carry: 0 = Restore from input, 1 = Save to output; X = Cursor column (if Carry = 0); Y = Cursor row (if Carry = 0).
Output: X = Cursor column (if Carry = 1); Y = Cursor row (if Carry = 1).
Used registers: X, Y.
Real address: $E50A.
$FFF3 IOBASE Fetch CIA #1 base address.
Input: –
Output: X/Y = CIA #1 base address ($DC00).
Used registers: X, Y.
Real address: $E500.