OpenCores
URL https://opencores.org/ocsvn/System09/System09/trunk

Subversion Repositories System09

[/] [System09/] [trunk/] [src/] [sys09bug/] [sys09atl.lst] - Blame information for rev 219

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 218 davidgb
Assembler release DWC_2.0 version 2.11
2
May 6, 2004 (c) Motorola (free ware)
3
0001                          NAM SYS09BUG FOR ATLYS
4
0000                          INCLUDE "opt_atl.asm"
5
0001                         *
6
0002                         ***************************************************
7
0003                         *   OPTION SWITCHES
8
0004                         ***************************************************
9
0005                         *
10
0006                         *
11
0007                         ** THE CONTROL PORT CAN ONLY BE ONE OF THESE
12
0008                         ** NOTE THAT THE ACIA WILL ALWAYS BE PRESET
13
0009                         ** FOR LOADING AND SAVING S1 RECORDS
14
0010                         *
15
0011                         *SWTOPT EQU $FF SWTP ACIA SERIAL CONTROL PORT
16
0012                         *ADSOPT EQU $FF ADS6809 & DG640 VIDEO DISPAY
17
0013                         *B3SOPT EQU $FF B3-SPARTAN2 FPGA VIDEO & PS2 KEYBOARD
18
0014                         *B5XOPT EQU $FF B5-X300 FPGA VIDEO & PS2 KEYBOARD
19
0015                         *S3SOPT EQU $FF SPARTAN3 STARTER FPGA VIDEO & PS2 KEYBOARD
20
0016                         *S3EOPT EQU $FF SPARTAN3E STARTER
21
0017                         *XESOPT EQU $FF XESS XSA-3S100 & XST-3.0
22
0018 00FF                    ATLOPT EQU $FF Digilent Atlys
23
0019                         *
24
0002                          END
25
0000                          INCLUDE "sys09equ.asm"
26
0001                         *
27
0002                         ***************************************************
28
0003                         *   MEMORY MAP EQUATES                            *
29
0004                         ***************************************************
30
0005 E000                    MONIO  EQU $E000  I/O SPACE
31
0006                                IFD B3SOPT
32
0007                         MONEXT EQU $F000  START OF EXTENDED COMMANDS
33
0008                         EXTCMD EQU $00    EXTENDED OFFSET
34
0009                                ENDIF B3SOPT
35
0009                                ENDIF B3SOPT
36
0010                                IFD S3EOPT
37
0011                         MONRAM EQU $7FC0
38
0012                                ELSE
39
0013 DFC0                    MONRAM EQU $DFC0  STACK SPACE
40
0014                                ENDIF S3EOPT
41
0015 F800                    MONROM EQU $F800  START OF ROM
42
0016                                IFD S3SOPT
43
0017                         MONEXT EQU $F000  START OF EXTENDED COMMANDS
44
0018                         EXTCMD EQU $00    EXTENDED OFFSET
45
0019                                ENDIF S3SOPT
46
0019                                ENDIF S3SOPT
47
0020                                IFD XESOPT
48
0021                         MONEXT EQU $F000  START OF EXTENDED COMMANDS
49
0022                         EXTCMD EQU $00    EXTENDED OFFSET
50
0023                                ENDIF XESOPT
51
0023                                ENDIF XESOPT
52
0024                                IFD DE270OPT
53
0025                         MONEXT EQU $F000  START OF EXTENDED COMMANDS
54
0026                         EXTCMD EQU $00    EXTENDED OFFSET
55
0027                                ENDIF DE270OPT
56
0027                                ENDIF DE270OPT
57
0028                         **************************************************
58
0029                         **************************************************
59
0030
60
0031                                 IFD SWTOPT
61
0032                         *
62
0033                         * SOUTH WEST TECHNICAL PRODUCTS COMPUTER
63
0034                         *
64
0035                         ACIAOPT EQU $FF ACIA AT PORT 0
65
0036                         DMAFOPT EQU $FF DMAF2 8" FLOPPY DISK BOOT
66
0037                         MFDCOPT EQU $FF MINIFLOPPY 5.25" DISK BOOT
67
0038                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
68
0039                                 ENDIF
69
0039                                 ENDIF
70
0040                         *
71
0041                                 IFD ADSOPT
72
0042                         *
73
0043                         * ACKERMAN DIGITAL ADS6809
74
0044                         *
75
0045                         DG640OPT  EQU $FF DG640 VDU AT $E800
76
0046                         *RTCOPT  EQU $FF REAL TIME CLOCK
77
0047                         PRTOPT  EQU $FF PRINTER DRIVERS
78
0048                         MFDCOPT EQU $FF MINIFLOPPY 5.25" DISK BOOT
79
0049                                 ENDIF ADSOPT
80
0049                                 ENDIF ADSOPT
81
0050                         *
82
0051                                 IFD B3SOPT
83
0052                         *
84
0053                         * BURCHED SPARTAN 2 B3+
85
0054                         *
86
0055                         ACIAOPT EQU $FF ACIA AT PORT 0
87
0056                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
88
0057                         VDUOPT  EQU $FF VDU AT $E030
89
0058                         IDEOPT  EQU $FF IDE AT $E100
90
0059                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
91
0060                         HFCOPT  EQU $FF HARDWARE FLOW CONTROL
92
0061                                 ENDIF B3SOPT
93
0061                                 ENDIF B3SOPT
94
0062                         *
95
0063                                 IFD B5XOPT
96
0064                         *
97
0065                         * BURCHED SPARTAN 2 B5-X300
98
0066                         *
99
0067                         ACIAOPT EQU $FF ACIA AT PORT 0
100
0068                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
101
0069                         VDUOPT  EQU $FF VDU AT $E030
102
0070                         CF8OPT  EQU $FF COMPACT FLASH AT $E040
103
0071                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
104
0072                         HFCOPT  EQU $FF HARDWARE FLOW CONTROL
105
0073                                 ENDIF B5XOPT
106
0073                                 ENDIF B5XOPT
107
0074                         *
108
0075                                 IFD S3SOPT
109
0076                         *
110
0077                         * DIGILENT SPARTAN 3 STARTER
111
0078                         *
112
0079                         ACIAOPT EQU $FF ACIA AT PORT 0
113
0080                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
114
0081                         VDUOPT  EQU $FF VDU AT $E030
115
0082                         CF8OPT  EQU $FF COMPACT FLASH AT $E040
116
0083                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
117
0084                         EXTOPT  EQU $FF EXTENDED COMMANDS
118
0085                                 ENDIF S3SOPT
119
0085                                 ENDIF S3SOPT
120
0086                         *
121
0087                                 IFD S3EOPT
122
0088                         *
123
0089                         * DIGILENT SPARTAN 3E STARTER
124
0090                         *
125
0091                         ACIAOPT EQU $FF ACIA AT PORT 0
126
0092                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
127
0093                         VDUOPT  EQU $FF VDU AT $E030
128
0094                         TRAOPT  EQU $FF PIA TRACE TIMER
129
0095                                 ENDIF S3EOPT
130
0095                                 ENDIF S3EOPT
131
0096                         *
132
0097                                 IFD XESOPT
133
0098                         *
134
0099                         * XESS SPARTAN 3 XSA-3S1000 & XST-3.0
135
0100                         *
136
0101                         ACIAOPT EQU $FF ACIA AT PORT 0
137
0102                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
138
0103                         VDUOPT  EQU $FF VDU AT $E030
139
0104                         IDEOPT  EQU $FF IDE AT $E100
140
0105                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
141
0106                         HFCOPT  EQU $FF HARDWARE FLOW CONTROL
142
0107                         EXTOPT  EQU $FF EXTENDED COMMANDS
143
0108                                 ENDIF XESOPT
144
0108                                 ENDIF XESOPT
145
0109                         *
146
0110                                 IFD DE270OPT
147
0111                         *
148
0112                         * TERASIC CYCLONE 2 DE2-70
149
0113                         *
150
0114                         ACIAOPT EQU $FF ACIA AT PORT 0
151
0115                         PS2OPT  EQU $FF PS2 KEYBOARD AT $E020
152
0116                         VDUOPT  EQU $FF VDU AT $E030
153
0117                         CF8OPT  EQU $FF COMPACT FLASH AT $E040
154
0118                         DATOPT  EQU $FF DYNAMIC ADDRESS TRANSLATION
155
0119                         EXTOPT  EQU $FF EXTENDED COMMANDS
156
0120                                 ENDIF DE270OPT
157
0120                                 ENDIF DE270OPT
158
0121                         *
159
0122                         *
160
0123                                 IFD   ACIAOPT
161
0124                         *
162
0125                         ***************************************************
163
0126                         *   SERIAL PORT                                   *
164
0127                         ***************************************************
165
0128                         *
166
0129                         ** ACIA SITS ON PORT 0
167
0130                         *
168
0131                         ACIAS   EQU   MONIO+$00   CONTROL PORT
169
0132                         *
170
0133                                 ENDIF ACIAOPT
171
0133                                 ENDIF ACIAOPT
172
0134                                 IFD   MFDCOPT
173
0135                         *
174
0136                         ***************************************************
175
0137                         *   MINIFLOPPY DRIVE                              *
176
0138                         ***************************************************
177
0139                         *
178
0140                         ** FLOPPY DISK CONTROLLER SITS ON PORT 1
179
0141                         *
180
0142                         DRVFDC  EQU   MONIO+$14
181
0143                         CMDFDC  EQU   MONIO+$18
182
0144                         SECFDC  EQU   MONIO+$1A
183
0145                         DATFDC  EQU   MONIO+$1B
184
0146                                 ENDIF MFDCOPT
185
0146                                 ENDIF MFDCOPT
186
0147                                 IFD PS2OPT
187
0148                         *
188
0149                         ***************************************************
189
0150                         *   VDU8 PS/2 KEYBOARD PORT                       *
190
0151                         ***************************************************
191
0152                         *
192
0153                         ** KEYBOARD SITS ON PORT 2
193
0154                         *
194
0155                         PS2KBD  EQU   MONIO+$20   PS/2 KEYBOARD PORT
195
0156                                 ENDIF PS2OPT
196
0156                                 ENDIF PS2OPT
197
0157                                 IFD VDUOPT
198
0158                         *
199
0159                         ***************************************************
200
0160                         *   VDU8 DISPLAY DRIVER EQUATES                   *
201
0161                         ***************************************************
202
0162                         *
203
0163                         ** VDU8 DISPLAY SITS ON PORT 3
204
0164                         *
205
0165                         VDU     EQU   MONIO+$30
206
0166                         VDUCHR  EQU   0        CHARACTER REGISTER
207
0167                         VDUATT  EQU   1        ATTRIBUTE REGISTER
208
0168                         VDUCOL  EQU   2        CURSOR COLUMN
209
0169                         VDUROW  EQU   3        CURSOR ROW
210
0170                         VDUOFF  EQU   4        ROW OFFSET
211
0171                         *
212
0172                         LINLEN  EQU   80       LENGTH OF A LINE
213
0173                         NUMLIN  EQU   25       NUMBER OF LINES
214
0174                                 ENDIF VDUOPT
215
0174                                 ENDIF VDUOPT
216
0175                         *
217
0176                                    IFD CF8OPT
218
0177                         *
219
0178                         ***************************************************
220
0179                         *   COMPACT FLASH EQUATES 8 BIT TRANSFER          *
221
0180                         ***************************************************
222
0181                         *
223
0182                         ** COMPACT FLASH SITS AT PORT 4
224
0183                         *
225
0184                         CF_BASE    EQU MONIO+$40
226
0185                         CF_DATA    EQU CF_BASE+0
227
0186                         CF_ERROR   EQU CF_BASE+1 ; read error
228
0187                         CF_FEATURE EQU CF_BASE+1 ; write feature
229
0188                         CF_SECCNT  EQU CF_BASE+2
230
0189                         CF_SECNUM  EQU CF_BASE+3
231
0190                         CF_CYLLO   EQU CF_BASE+4
232
0191                         CF_CYLHI   EQU CF_BASE+5
233
0192                         CF_HEAD    EQU CF_BASE+6
234
0193                         CF_STATUS  EQU CF_BASE+7 ; read status
235
0194                         CF_COMAND  EQU CF_BASE+7 ; write command
236
0195                         *
237
0196                         * Command Equates
238
0197                         *
239
0198                         CMDREAD    EQU $20 ; Read Single sector
240
0199                         CMDWRITE   EQU $30 ; Write Single sector
241
0200                         CMDFEATURE EQU $EF
242
0201                         FEAT8BIT   EQU $01 ; enable 8 bit transfers
243
0202                         HEADLBA    EQU $E0
244
0203                         *
245
0204                         * Status bit equates
246
0205                         *
247
0206                         BUSY       EQU $80
248
0207                         DRDY       EQU $40
249
0208                         DRQ        EQU $08
250
0209                         ERR        EQU $01
251
0210                         *
252
0211                                    ENDIF CF8OPT
253
0211                                    ENDIF CF8OPT
254
0212                         *
255
0213                                    IFD IDEOPT
256
0214                         *
257
0215                         ***************************************************
258
0216                         *   COMPACT FLASH EQUATES 16 BIT TRANSFER (XESS)  *
259
0217                         ***************************************************
260
0218                         *
261
0219                         ** COMPACT FLASH SITS AT PORT 4
262
0220                         *
263
0221                         CF_BASE    EQU MONIO+$0100
264
0222                         CF_DATA    EQU CF_BASE+0
265
0223                         CF_ERROR   EQU CF_BASE+2 ; read error
266
0224                         CF_FEATURE EQU CF_BASE+2 ; write feature
267
0225                         CF_SECCNT  EQU CF_BASE+4
268
0226                         CF_SECNUM  EQU CF_BASE+6
269
0227                         CF_CYLLO   EQU CF_BASE+8
270
0228                         CF_CYLHI   EQU CF_BASE+10
271
0229                         CF_HEAD    EQU CF_BASE+12
272
0230                         CF_STATUS  EQU CF_BASE+14 ; read status
273
0231                         CF_COMAND  EQU CF_BASE+14 ; write command
274
0232                         CF_AUX     EQU CF_BASE+30
275
0233                         *
276
0234                         * Command Equates
277
0235                         *
278
0236                         CMDREAD    EQU $20 ; Read Single sector
279
0237                         CMDWRITE   EQU $30 ; Write Single sector
280
0238                         AUXRESET   EQU $06 ; Reset IDE
281
0239                         AUXRSTREL  EQU $02 ; Reset release IRQ masked
282
0240                         HEADLBA    EQU $E0
283
0241                         *
284
0242                         * Status bit equates
285
0243                         *
286
0244                         BUSY       EQU $80
287
0245                         DRDY       EQU $40
288
0246                         DRQ        EQU $08
289
0247                         ERR        EQU $01
290
0248                         *
291
0249                                    ENDIF CF8OPT
292
0249                                    ENDIF CF8OPT
293
0250                         *
294
0251                                 IFD RTCOPT
295
0252                         *
296
0253                         **************************************************
297
0254                         * MM58167A REAL TIME CLOCK MEMORY MAP:
298
0255                         **************************************************
299
0256                         *
300
0257                         ** REAL TIME CLOCK SITS ON PORT 4 AND PORT 5
301
0258                         *
302
0259                         CLOCK  EQU MONIO+$40 CLOCK BASE ADDRESS AND REGISTERS
303
0260                         *
304
0261                         * COUNTER AND COMPARITOR REGISTERS:
305
0262                         *
306
0263                         * Both the Clock Counter and Clock Comparitor
307
0264                         * consist of 8 registers for holding the time.
308
0265                         * The register offsets from the Counter and
309
0266                         * Comparitor registers are listed above.
310
0267                         *
311
0268                         COUNTR EQU CLOCK+0
312
0269                         CMPRAM EQU CLOCK+8 COMPARITOR REGISTERS
313
0270                         *
314
0271                         * CLOCK REGISTER OFFSETS:
315
0272                         * These register offsets are used for the CLOCK
316
0273                         * and comparitor ram CMPRAM.
317
0274                         *
318
0275                         S10000 EQU 0 TEN THOUNSANDTHS OF SECONDS
319
0276                         S100   EQU 1 HUNDRETHS AND TENTHS OF SECONDS
320
0277                         SECOND EQU 2
321
0278                         MINUIT EQU 3
322
0279                         HOUR   EQU 4
323
0280                         WKDAY  EQU 5
324
0281                         MTHDAY EQU 6
325
0282                         MONTH  EQU 7
326
0283                         *
327
0284                         * INTERRUPT OUTPUT REGISTERS:
328
0285                         *
329
0286                         * An interrupt output may be generated at the
330
0287                         * following rates by setting the appropriate bit
331
0288                         * in the Interrupt Control Register (CINTCR).
332
0289                         * The Interrupt Status Register (CINTSR) must be
333
0290                         * read to clear the interrupt and will return
334
0291                         * the source of the interrupt.
335
0292                         *
336
0293                         * 1/Month      Bit 7
337
0294                         * 1/Week       Bit 6
338
0295                         * 1/Day        Bit 5
339
0296                         * 1/Hour       Bit 4
340
0297                         * 1/Minuite    Bit 3
341
0298                         * 1/Second     Bit 2
342
0299                         * 10/Second    Bit 1
343
0300                         * Comparitor   Bit 0
344
0301                         *
345
0302                         CINTSR  EQU CLOCK+16 INTERRUPT STATUS REGISTER
346
0303                         CINTCR  EQU CLOCK+17 INTERRUPT CONTROL REGISTER
347
0304                         *
348
0305                         * COUNTER AND RAM RESETS; GO COMMAND.
349
0306                         *
350
0307                         * The counter and comparitor may be reset
351
0308                         * by writing $FF into CTRRES and CMPRES
352
0309                         * respectivly.
353
0310                         * A write to the Go command register (GOCMND)
354
0311                         * will reset the 1/1000ths, 1/100ths and 1/10ths
355
0312                         * of a second counter.
356
0313                         *
357
0314                         CTRRES EQU CLOCK+18 COUNTER RESET
358
0315                         CMPRES EQU CLOCK+19 COMPARITOR RAM RESET
359
0316                         GOCMND EQU CLOCK+21 GO COMMAND
360
0317                         *
361
0318                         * CLOCK STATUS REGISTER.
362
0319                         *
363
0320                         * The counter takes 61 usec. to rollover for
364
0321                         * every 1KHz clock pulse. If the Status bit is
365
0322                         * set after reading the counter, the counter
366
0323                         * should be re-read to ensure the time is correct.
367
0324                         *
368
0325                         CLKSTA EQU CLOCK+20 STATUS BIT
369
0326                         SBYINT EQU CLOCK+22 STANDBY INTERRUPT
370
0327                         TSTMOD EQU CLOCK+31 TEST MODE REGISTER
371
0328                                ENDIF RTCOPT
372
0328                                ENDIF RTCOPT
373
0329                         *
374
0330                                IFD TRAOPT
375
0331                         *
376
0332                         **************************************************
377
0333                         * PIA INTERRUPT TIMER
378
0334                         **************************************************
379
0335                         *
380
0336                         ** PIA INTERRUPT TIMER SITS ON PORT 7
381
0337                         *
382
0338                         ** PIA TIMER FOR SINGLE STEP / TRACE
383
0339                         *
384
0340                         * TADATA = Output = Timer preset register
385
0341                         * TACTRL - CA1 = input = rising edge = NMI
386
0342                         *        - CA2 = Output = Timer Reset (Active High)
387
0343                         * TBDATA = Input = Timer read back register
388
0344                         * TBCTRL - CB1 = input = rising edge = FIRQ
389
0345                         *        - CB2 = output = strobe low on write to TBDATA = Timer Preset
390
0346                         *
391
0347                         * CRA0 = 0 CA1 IRQ DISAB, CRA0 = 1 CA1 IRQ ENAB
392
0348                         * CRA1 = 1 CA1 Rising edge IRQ
393
0349                         * CRA2 = 0 TADATA = Data Direction, CRA2 = 1 TADATA = I/O Register
394
0350                         * CRA3 = 0 CA2 = 0 output, CRA3 = 1 CA2 = 1
395
0351                         * CRA4 = 1 ] CA2 = Set/Reset output
396
0352                         * CRA5 = 1 ]
397
0353                         * CRA6 = X CA2 Input Interrupt Flag
398
0354                         * CRA7 = X CA1 Interrupt Flag
399
0355                         *
400
0356                         * CRB0 = 0 CB1 IRQ DISAB, CRB0 = 1 CA1 IRQ ENAB
401
0357                         * CRB1 = 1 CB1 Rising edge IRQ
402
0358                         * CRB2 = 0 TBDATA = Data Direction, CRB2 = 1 TBDATA = I/O Register
403
0359                         * CRB3 = 0 CB2 = 0 output, CRB3 = 1 CB2 = 1
404
0360                         * CRB4 = 1 ] CB2 = Set/Reset output
405
0361                         * CRB5 = 1 ]
406
0362                         * CRB6 = X CB2 Input Interrupt Flag
407
0363                         * CRB7 = X CB1 Interrupt Flag
408
0364                         *
409
0365                         * DDRA = 0 TADATA = Input, DDRA = 1 TADATA = Output
410
0366                         * DDRB = 0 TBDATA = Input, DDRB = 1 TBDATA = Output
411
0367                         *
412
0368                         TADATA EQU MONIO+$70 Timer preset port
413
0369                         TACTRL EQU MONIO+$71
414
0370                         TBDATA EQU MONIO+$72 Timer read back port
415
0371                         TBCTRL EQU MONIO+$73
416
0372                         *
417
0373                         TRADEL EQU 13  Number of E cycles for RTI (May need to be fudged)
418
0374                         *
419
0375                                ENDIF TRAOPT
420
0375                                ENDIF TRAOPT
421
0376                                IFD ADSOPT
422
0377                         *
423
0378                         ***************************************************
424
0379                         *   SERIAL PORT FOR DG640                         *
425
0380                         ***************************************************
426
0381                         *
427
0382                         ** SET UP FOR ACKERMAN DIGITAL ADS6809
428
0383                         ** THE ADS6809 S100 BOAD HAS AN ON BOARD ACIA
429
0384                         *
430
0385                         ACIAS   EQU   MONIO+$400   CONTROL PORT
431
0386                         *
432
0387                                 ENDIF ADSOPT
433
0387                                 ENDIF ADSOPT
434
0388                                 IFD PRTOPT
435
0389                         *
436
0390                         ***************************************************
437
0391                         * PRINTER INTERFACE                               *
438
0392                         ***************************************************
439
0393                         *
440
0394                         PADATA EQU MONIO+$404
441
0395                         PACTRL EQU MONIO+$405
442
0396                         PBDATA EQU MONIO+$406
443
0397                         PBCTRL EQU MONIO+$407
444
0398                         *
445
0399                         ** CB1  ACK.  I/P
446
0400                         ** CB2  STB.  O/P
447
0401                         ** PB0 - PB7   DATA 1 - 8   O/P
448
0402                         ** PORT A BIT ASSIGNMENT
449
0403                         *
450
0404                         PBUSY  EQU $80 I/P
451
0405                         PEMPTY EQU $40 I/P
452
0406                         SELECT EQU $20 I/P
453
0407                         PERROR EQU $10 I/P
454
0408                         PRESET EQU %00000100 O/P PA3 = 0
455
0409                         AUTOFD EQU %00001000 O/P PA2 = 0
456
0410                         DIRMSK EQU %00001100
457
0411                                ENDIF PRTOPT
458
0411                                ENDIF PRTOPT
459
0412                                IFD DG640OPT
460
0413                         *
461
0414                         ***************************************************
462
0415                         *   DG640 MEMORY MAPPED DISPLAY DRIVER VARIABLES  *
463
0416                         ***************************************************
464
0417                         *
465
0418                         ** VIDEO DISPLAY DEFINITIONS
466
0419                         *
467
0420                         SCREEN  EQU   MONIO+$0800 START OF SCREEN MEMORY
468
0421                         LINLEN  EQU   64          LENGTH OF A LINE
469
0422                         NUMLIN  EQU   16          NUMBER OF LINES
470
0423                         SCNLEN  EQU   $400        LENGTH OF SCREEN
471
0424                                 ENDIF DG640OPT
472
0424                                 ENDIF DG640OPT
473
0425                         *
474
0426                                 IFD   DMAFOPT
475
0427                         *
476
0428                         ***************************************************
477
0429                         *   DMAF2 8" DRIVE                                *
478
0430                         ***************************************************
479
0431                         *
480
0432                         ADDREG  EQU   $F000  ADDRESS REGISTER
481
0433                         CNTREG  EQU   $F002  COUNT REGISTER
482
0434                         CCREG   EQU   $F010  CHANNEL CONTROL REGISTER
483
0435                         PRIREG  EQU   $F014  DMA PRIORITY REGISTER
484
0436                         AAAREG  EQU   $F015  ???
485
0437                         BBBREG  EQU   $F016  ???
486
0438                         COMREG  EQU   $F020  1791 COMMAND REGISTER
487
0439                         SECREG  EQU   $F022  SECTOR REGISTER
488
0440                         DRVREG  EQU   $F024  DRIVE SELECT LATCH
489
0441                         CCCREG  EQU   $F040  ???
490
0442                                 ENDIF DMAFOPT
491
0442                                 ENDIF DMAFOPT
492
0443                                 IFD DATOPT
493
0444                         **************************************************
494
0445                         * DYNAMIC ADDRESS TRANSLATION REGISTERS          *
495
0446                         **************************************************
496
0447                         *
497
0448                         IC11    EQU  $FFF0  DAT RAM CHIP
498
0449                         TSTPAT  EQU  $55AA  TEST PATTERN
499
0450                                 ENDIF DATOPT
500
0450                                 ENDIF DATOPT
501
0451                         *
502
0003                                 END
503
0000                          INCLUDE "sys09nul.asm"
504
0001                         *
505
0002                         ** SYS09BUG MONITOR EXTENSIONS
506
0003                         *
507
0004                         * FOR GENERIC SYS09BUG
508
0005                         * WITH I/O MAPPED AT $XE000
509
0006                         * AND ROM MAPPED AT $XF000
510
0007                         * (JUST A COPY OF SYS09IDE.ASM
511
0008                         * TO FILL THE MEMORY AT F000)
512
0009                         *
513
0010                         *
514
 
515
 
516
sys09nul.asm                                                                      page   2
517
0012                         *
518
0013                         ***************************************************
519
0014                         * Serial PROM register
520
0015                         ***************************************************
521
0016                         *
522
0017                         ** CONFIGURATION PROM DEFINITIONS
523
0018                         *
524
0019 E0C0                    PROMREG EQU MONIO+$C0
525
0020 0001                    PCLKHI  EQU $01     Toggle PROM Clock High
526
0021 0000                    PCLKLO  EQU $00     Toggle PROM Clock Low
527
0022 0002                    PRSTHI  EQU $02     Toggle PROM Reset High
528
0023 0000                    PRSTLO  EQU $00     Toggle PROM Reset Low
529
0024 AA55                    SYNCHI  EQU $AA55   Synch Pattern High Word
530
0025 FF00                    SYNCLO  EQU $FF00   Synch Pattern Low Word
531
0026                         *
532
0027                         *
533
0028                         ***************************************************
534
0029                         *   START OF ROM                                  *
535
0030                         ***************************************************
536
0031                         *
537
0032 F800                    MONITV EQU MONROM+0  FDB MONITOR
538
0033 F802                    NXTCMV EQU MONROM+2  FDB NEXTCMD
539
0034 F804                    INCHV  EQU MONROM+4  FDB INCH
540
0035 F806                    INCHEV EQU MONROM+6  FDB INCHE
541
0036 F808                    INCHKV EQU MONROM+8  FDB INCHEK
542
0037 F80A                    OUTCHV EQU MONROM+10 FDB OUTCH
543
0038 F80C                    PDATAV EQU MONROM+12 FDB PDATA
544
0039 F80E                    PCRLFV EQU MONROM+14 FDB PCRLF
545
0040 F810                    PSTRGV EQU MONROM+16 FDB PSTRNG
546
0041 F812                    LRAV   EQU MONROM+18 FDB LRA
547
0042                         *
548
0043                         * Condition code flags
549
0044                         *
550
0045 0001                    CFLAG   EQU $01     CARRY FLAG
551
0046 0002                    VFLAG   EQU $02     OVERFLOW FLAG
552
0047 0004                    ZFLAG   EQU $04     ZERO FLAG
553
0048 0008                    NFLAG   EQU $08     NEGATIVE FLAG
554
0049 0010                    IFLAG   EQU $10     IRQ MASK CC
555
0050 0020                    HFLAG   EQU $20     HALF CARRY
556
0051 0040                    FFLAG   EQU $40     FIRQ MASK CC
557
0052 0080                    EFLAG   EQU $80     ENTIRE FLAG
558
0053                         *
559
0054                         * Serial Port
560
0055                         *
561
Symbol 'ACIAS' undefined Pass 20056 0000                    ACIAC1  EQU ACIAS
562
Symbol 'ACIAS' undefined Pass 20057 0001                    ACIAD1  EQU ACIAS+1
563
0058 04E2                    DELCON  EQU 1250    Delay (Processor clock in MHz * 50)
564
0059                         *
565
0060                         * XMODEM Control characters
566
0061                         *
567
0062 0001                    SOH     EQU $01
568
0063 0004                    EOT     EQU $04
569
0064 0006                    ACK     EQU $06
570
0065 0015                    NAK     EQU $15
571
0066 0018                    CAN     EQU $18
572
0067                         *
573
0068                         * Some Disk Constants
574
0069                         *
575
0070 0100                    RMAXTRK EQU 256
576
0071 00FF                    RMAXSEC EQU 255
577
0072 FE01                    RTOTSEC EQU RMAXTRK*RMAXSEC-RMAXSEC
578
0073                         *
579
0074                         * RAM SPACE
580
0075                         *
581
0076                         * PUT THIS DOWN THE BOTTOM OF MEMORY
582
0077                         *
583
0078 0100                            ORG  $0100
584
0079 0100                    DRVNUM  RMB 1
585
0080 0101                    TRACK   RMB 1
586
0081 0102                    SECTOR  RMB 1
587
0082 0103                    CHKSUM  RMB 1
588
0083 0104                    BLKNUM  RMB 1 Xmodem block number
589
0084 0105                    BYTCNT  RMB 1 Xmodem byte count
590
0085 0106                    XSTATE  RMB 2 Xmodem State Vector
591
0086 0108                    DELCNT  RMB 3  $00,$00,$00 Xmodem Poll timer
592
0087 010B                    MAXTRK  RMB 1
593
0088 010C                    MAXSEC  RMB 1
594
0089 0200                            ORG  $0200
595
0090                         *
596
0091                         * SECTOR BUFFER
597
0092                         *
598
0093 0200                    BUFFER  RMB  256
599
0094                         *
600
0095                         ****************************************
601
0096                         *
602
0097                         * START OF EXTENSION COMMANDS
603
0098                         *
604
0099                         ****************************************
605
0100                         *
606
Symbol 'MONEXT' undefined Pass 20101 0000                            ORG MONEXT
607
0102 0000 00 02                      FDB NEXTEXT   Jump to next extended command
608
0103                         *
609
0104                         ***** NEXTCMD *****
610
0105                         *
611
0106 0002 AD 9F F8 06        NEXTEXT JSR [INCHEV]  GET ONE CHAR. FROM TERMINAL
612
0107 0006 84 7F                      ANDA #$7F STRIP PARITY FROM CHAR.
613
0108 0008 1F 89                      TFR  A,B
614
0109 000A 86 20                      LDA  #$20
615
0110 000C AD 9F F8 0A                JSR [OUTCHV] PRNT SPACE
616
0111 0010 C1 60                      CMPB #$60
617
0112 0012 2F 02                      BLE NXTEX0
618
0113 0014 C0 20                      SUBB #$20
619
0114                         *
620
0115                         ***** DO TABLE LOOKUP *****
621
0116                         *   FOR COMMAND FUNCTIONS
622
0117                         *
623
0118 0016 8E 00 2C           NXTEX0  LDX #EXTTAB    POINT TO JUMP TABLE
624
0119 0019 E1 80              NXTEX1  CMPB ,X+       DOES COMMAND MATCH TABLE ENTRY ?
625
0120 001B 27 0D                      BEQ  JMPEXT    BRANCH IF MATCH FOUND
626
0121 001D 30 02                      LEAX 2,X       POINT TO NEXT ENTRY IN TABLE
627
0122 001F 8C 00 35                   CMPX #EXTEND   REACHED END OF TABLE YET ?
628
0123 0022 26 F5                      BNE  NXTEX1    IF NOT END, CHECK NEXT ENTRY
629
0124 0024 8E 00 35                   LDX  #MSGWHAT  POINT TO MSG "WHAT?"
630
0125 0027 16 02 1E                   LBRA PDATA1    PRINT MSG AND RETURN
631
0126 002A 6E 94              JMPEXT  JMP  [,X]      JUMP TO COMMAND ROUTINE
632
0127                         *
633
0128                         * EXTENDED COMMAND JUMP TABLE
634
0129                         *
635
0130 002C                    EXTTAB EQU *
636
0131 002C 42                        FCC 'B'   BOOT FLEX
637
0132 002D 00 3E                     FDB UBSUB
638
0133 002F 46                        FCC 'F'   FORMAT IDE DISK
639
0134 0030 00 E6                     FDB UFSUB
640
0135 0032 58                        FCC 'X'   XMODEM ROM DISK UPLOAD
641
0136 0033 02 B1                     FDB UXSUB
642
0137                         *
643
0138 0035                    EXTEND EQU *
644
0139                         *
645
0140 0035 57 48 41 54 20 3F  MSGWHAT FCC "WHAT ?"
646
0141 003B 0A 0D 04                   FCB $0A,$0D,$04
647
0142                         *
648
0143                         * GO TO FLEX RESIDENT IN MEMORY
649
0144                         *
650
0145 003E 8E CD 00           UBSUB   LDX #$CD00
651
0146 0041 AF 4A                      STX 10,U
652
0147 0043 1F 34                      TFR  U,S
653
0148 0045 3B                         RTI
654
0149                         *
655
0150                         * recieve char from remote drive.
656
0151                         * timeout if no response for approx 1s.
657
0152                         * Entry: no parameters
658
0153                         * Exit:  (A) = recieved char, (C)=1 if valid char, (C)=0 if timeout.
659
0154                         *
660
0155 0046 34 30              RCHAR   PSHS    X,Y
661
0156                         *
662
0157 0048 8E 03 E8                   LDX     #1000         1000x inner loop
663
0158 004B 10 8E 04 E2        RCHAR1  LDY     #DELCON       delay constant for inner loop (approx 1ms).
664
0159 004F 96 00              RCHAR2  LDA     ACIAC1        test for recieved char
665
0160 0051 47                         ASRA
666
0161 0052 25 0A                      BCS     RCHAR3        get character
667
0162 0054 31 3F                      LEAY    -1,Y          else, continue to count delay
668
0163 0056 26 F7                      BNE     RCHAR2
669
0164 0058 30 1F                      LEAX    -1,X
670
0165 005A 26 EF                      BNE     RCHAR1
671
0166 005C 35 B0                      PULS    X,Y,PC        return with error if timed out
672
0167                         *
673
0168 005E 96 01              RCHAR3  LDA     ACIAD1        return data (carry bit still set)
674
0169 0060 35 B0                      PULS    X,Y,PC
675
0170                         *
676
0171                         *
677
0172                         * transmit char to remote drive.
678
0173                         * timeout if no response for approx 1s. (allows for use of hardware flow control)
679
0174                         * Entry: (A) = char to transmit
680
0175                         * Exit:  (A) = recieved char, (C)=1 if valid char, (C)=0 if timeout.
681
0176                         *
682
0177 0062 34 30              SCHAR   PSHS    X,Y
683
0178 0064 34 02                      PSHS    A
684
0179                         *
685
0180 0066 8E 03 E8                   LDX     #1000         1000x inner loop
686
0181 0069 10 8E 04 E2        SCHAR1  LDY     #DELCON       delay constant for inner loop (approx 1ms).
687
0182 006D 96 00              SCHAR2  LDA     ACIAC1        test for space in transmit FIFO
688
0183 006F 47                         ASRA
689
0184 0070 47                         ASRA
690
0185 0071 25 0C                      BCS     SCHAR3        send character
691
0186 0073 31 3F                      LEAY    -1,Y          else, continue to count delay
692
0187 0075 26 F6                      BNE     SCHAR2
693
0188 0077 30 1F                      LEAX    -1,X
694
0189 0079 26 EE                      BNE     SCHAR1
695
0190 007B 35 02                      PULS    A
696
0191 007D 35 B0                      PULS    X,Y,PC        return with error if timed out
697
0192                         *
698
0193 007F 35 02              SCHAR3  PULS    A
699
0194 0081 97 01                      STA     ACIAD1        send data (carry bit still set)
700
0195 0083 35 B0                      PULS    X,Y,PC
701
0196                         *
702
0197                         ** 'UF' Format IDE Drive to FLEX standard.
703
0198                         *
704
0199 0085 0A 0D              DISFOS  FCB $0A,$0D
705
0200 0087 46 6F 72 6D 61 74          FCC 'Formating IDE disk... '
706
          69 6E 67 20 49 44
707
          45 20 64 69 73 6B
708
          2E 2E 2E 20
709
0201 009D 0A 0D                      FCB $0A,$0D
710
0202 009F 44 72 69 76 65 20          FCC 'Drive Number ?'
711
          4E 75 6D 62 65 72
712
          20 3F
713
0203 00AD 04                         FCB 4
714
0204 00AE 0A 0D 04           MESS6   FCB $0A,$0D,4
715
0205 00B1 49 44 45 20 64 72          FCC 'IDE drive not allocated! '
716
          69 76 65 20 6E 6F
717
          74 20 61 6C 6C 6F
718
          63 61 74 65 64 21
719
          20
720
0206 00CA 04                    FCB 4
721
0207 00CB 0A 0D              UFMSG1  FCB $0A,$0D
722
0208 00CD 46 6F 72 6D 61 74          FCC 'Format Complete'
723
          20 43 6F 6D 70 6C
724
          65 74 65
725
0209 00DC 04                         FCB 4
726
0210 00DD 49 44 45 44 49 53  VOLMSG  FCC 'IDEDISK '
727
          4B 20
728
0211 00E5 04                         FCB 4
729
0212                         *
730
0213 00E6 BD 04 B2           UFSUB   JSR  INITDR
731
0214 00E9 8E 00 85                   LDX #DISFOS
732
0215 00EC BD 02 48                   JSR PDATA1
733
0216 00EF 17 FF 54           UFSUB1  LBSR RCHAR
734
0217 00F2 24 FB                      BCC  UFSUB1
735
0218 00F4 17 FF 6B                   LBSR SCHAR
736
0219 00F7 81 30                      CMPA #'0'
737
0220 00F9 10 25 00 EF                LBLO UFEXIT
738
0221 00FD 81 33                      CMPA #'3'
739
0222 00FF 10 22 00 E9                LBHI  UFEXIT
740
0223 0103 80 30                      SUBA #'0'
741
0224 0105 1F 89                      TFR  A,B
742
0225 0107 F7 01 00                   STB DRVNUM
743
0226 010A 8E 00 FD                   LDX #DRVNUM-3
744
0227 010D BD 05 2F                   JSR DRVSEL
745
0228                         *
746
0229                         * set up free chain
747
0230                         *
748
0231 0110 8E 02 00                   LDX #BUFFER clear out buffer
749
0232 0113 4F                         CLRA
750
0233 0114 5F                         CLRB
751
0234 0115 A7 80              DFL1    STA 0,X+
752
0235 0117 5A                         DECB
753
0236 0118 26 FB                      BNE DFL1
754
0237                         *
755
0238 011A 7F 01 01                   CLR TRACK
756
0239 011D 86 01                      LDA #1
757
0240 011F B7 01 02                   STA SECTOR
758
0241 0122 8E 02 00           DFL2    LDX #BUFFER
759
0242 0125 B6 01 01                   LDA TRACK
760
0243 0128 A7 84                      STA 0,X
761
0244 012A B6 01 02                   LDA SECTOR
762
0245 012D 4C                         INCA
763
0246 012E 81 00                      CMPA #RMAXSEC+1 last sector on track?
764
0247 0130 26 04                      BNE DFL3
765
0248 0132 6C 84                      INC 0,X
766
0249 0134 86 01                      LDA #1
767
0250 0136 A7 01              DFL3    STA 1,X
768
0251 0138 B6 01 01                   LDA TRACK
769
0252 013B F6 01 02                   LDB SECTOR
770
0253 013E BD 05 0A                   JSR WRITSC
771
0254 0141 7C 01 02                   INC SECTOR
772
0255 0144 B6 01 02                   LDA SECTOR
773
0256 0147 81 00                      CMPA #RMAXSEC+1
774
0257 0149 26 D7                      BNE DFL2
775
0258 014B 86 01                      LDA #1
776
0259 014D B7 01 02                   STA  SECTOR
777
0260 0150 7C 01 01                   INC TRACK
778
0261 0153 B6 01 01                   LDA TRACK
779
0262 0156 81 00                      CMPA #RMAXTRK
780
0263 0158 26 C8                      BNE DFL2
781
0264                         * break free chain at last track/sector
782
0265 015A 8E 02 00                   LDX  #BUFFER
783
0266 015D 86 FF                      LDA  #RMAXTRK-1
784
0267 015F C6 FF                      LDB  #RMAXSEC
785
0268 0161 BD 04 E6                   JSR  READSC
786
0269 0164 8E 02 00                   LDX  #BUFFER
787
0270 0167 6F 84                      CLR  0,X
788
0271 0169 6F 01                      CLR  1,X
789
0272 016B 86 FF                      LDA  #RMAXTRK-1
790
0273 016D C6 FF                      LDB  #RMAXSEC
791
0274 016F BD 05 0A                   JSR  WRITSC
792
0275                         * set up sector structure, SIR, directory etc
793
0276 0172 8E 02 00                   LDX  #BUFFER
794
0277 0175 4F                         CLRA
795
0278 0176 C6 FF                      LDB  #RMAXSEC
796
0279 0178 BD 04 E6                   JSR  READSC
797
0280 017B 8E 02 00                   LDX  #BUFFER
798
0281 017E 6F 84                      CLR  0,X break end of directory chain
799
0282 0180 6F 01                      CLR  1,X
800
0283 0182 4F                         CLRA
801
0284 0183 C6 FF                      LDB  #RMAXSEC
802
0285 0185 BD 05 0A                   JSR  WRITSC
803
0286                         *
804
0287 0188 8E 02 00                   LDX  #BUFFER
805
0288 018B 4F                         CLRA
806
0289 018C C6 03                      LDB  #3 set up SIR
807
0290 018E BD 04 E6                   JSR  READSC
808
0291 0191 8E 02 00                   LDX  #BUFFER
809
0292 0194 6F 84                      CLR  0,X break forward link
810
0293 0196 6F 01                      CLR  1,X
811
0294                         *
812
0295 0198 34 20                      PSHS Y
813
0296 019A 10 8E 00 DD                LDY  #VOLMSG
814
0297 019E C6 10                      LDB  #16
815
0298 01A0 A6 A0              DFL4    LDA  ,Y+
816
0299 01A2 A7 85                      STA  B,X
817
0300 01A4 5C                         INCB
818
0301 01A5 C1 18                      CMPB #24
819
0302 01A7 26 F7                      BNE  DFL4
820
0303 01A9 35 20                      PULS Y
821
0304                         *
822
0305 01AB 4F                         CLRA
823
0306 01AC F6 01 00                   LDB  DRVNUM volume number
824
0307 01AF ED 88 1B                   STD  27,X
825
0308                         *
826
0309 01B2 CC 01 01                   LDD  #$0101 first trk/sec  01-01
827
0310 01B5 ED 88 1D                   STD  29,X
828
0311 01B8 86 FF                      LDA  #RMAXTRK-1
829
0312 01BA C6 FF                      LDB  #RMAXSEC
830
0313 01BC ED 88 1F                   STD  31,X
831
0314 01BF ED 88 26                   STD  38,X
832
0315 01C2 CC FE 01                   LDD  #RTOTSEC total DATA sectors (2912-14)
833
0316 01C5 ED 88 21                   STD  33,X
834
0317                         *
835
0318 01C8 86 01                      LDA #01 month   set default creation date (SYS09's birthday!)
836
0319 01CA A7 88 23                   STA 35,X
837
0320 01CD 86 07                      LDA #07 day
838
0321 01CF A7 88 24                   STA 36,X
839
0322 01D2 86 07                      LDA #07 year
840
0323 01D4 A7 88 25                   STA 37,X
841
0324                         *
842
0325 01D7 4F                 RF3     CLRA
843
0326 01D8 C6 03                      LDB  #3
844
0327 01DA BD 05 0A                   JSR  WRITSC
845
0328                         *
846
0329                         * Not sure what this is about
847
0330                         * put bootstrap on track 0 sector 1
848
0331                         *
849
0332                         *        LDX #BUFFER
850
0333                         *        CLRA
851
0334                         *        LDB #1
852
0335                         *        JSR READSC
853
0336                         *        LDX #BUFFER
854
0337                         *        LDA #$AA set the init flag
855
0338                         *        STA 0,X
856
0339                         *        LDA  #$55
857
0340                         *        STA 1,X
858
0341                         *        CLRA
859
0342                         *        LDB #1
860
0343                         *        JSR WRITSC
861
0344                         *
862
0345                         *  Write Boot sector
863
0346                         *
864
0347 01DD 8E 07 00                   LDX  #BOOT
865
0348 01E0 4F                         CLRA         TRACK 0
866
0349 01E1 C6 01                      LDB  #$01    SECTOR 1
867
0350 01E3 B7 01 01                   STA  TRACK
868
0351 01E6 F7 01 02                   STB  SECTOR
869
0352 01E9 17 03 1E                   LBSR WRITSC
870
0353                         *
871
0354 01EC 8E 00 CB           UFEXIT  LDX #UFMSG1
872
0355 01EF 7E 02 48                   JMP PDATA1
873
0356                         *
874
0357                         * ACIA INPUT TEST
875
0358                         *
876
0359 01F2 96 00              INTEST  LDA ACIAC1
877
0360 01F4 85 01                      BITA #$01
878
0361 01F6 39                         RTS
879
0362                         *
880
0363                         * RESET ACIA
881
0364                         *
882
0365 01F7 86 03              ACIRST  LDA #$03 master reset
883
0366 01F9 97 00                      STA  ACIAC1
884
0367 01FB 86 11                      LDA #$11
885
0368 01FD 97 00                      STA ACIAC1
886
0369 01FF 39                         RTS
887
0370                         *
888
0371                         * ACIA INPUT
889
0372                         *
890
0373 0200 86 10              INTER   LDA  #16
891
0374 0202 B7 01 08                   STA  DELCNT+0
892
0375 0205 7F 01 09                   CLR  DELCNT+1
893
0376 0208 7F 01 0A                   CLR  DELCNT+2
894
0377 020B 96 00              INTER0  LDA  ACIAC1
895
0378 020D 85 01                      BITA #$01
896
0379 020F 26 08                      BNE  INTER1
897
0380 0211 85 78                      BITA #$78
898
0381 0213 27 09                      BEQ  INTER2
899
0382 0215 8D E0                      BSR  ACIRST
900
0383 0217 20 E7                      BRA  INTER
901
0384                         *
902
0385 0219 96 01              INTER1  LDA  ACIAD1
903
0386 021B 1C FD                      ANDCC #$FF-VFLAG
904
0387 021D 39                         RTS
905
0388                         *
906
0389 021E 7A 01 0A           INTER2  DEC  DELCNT+2
907
0390 0221 26 E8                      BNE  INTER0
908
0391 0223 7A 01 09                   DEC  DELCNT+1
909
0392 0226 26 E3                      BNE  INTER0
910
0393 0228 7A 01 08                   DEC  DELCNT+0
911
0394 022B 26 DE                      BNE  INTER0
912
0395 022D 4F                         CLRA
913
0396 022E 1A 02                      ORCC #VFLAG
914
0397 0230 39                         RTS
915
0398                         *
916
0399                         * ACIA OUTPUT
917
0400                         *
918
0401 0231 34 02              OUTTER  PSHS A
919
0402                         *
920
0403 0233 96 00              OUTTE1  LDA ACIAC1
921
0404 0235 85 02                      BITA #$02
922
0405 0237 26 08                      BNE  OUTTE2
923
0406 0239 85 78                      BITA #$78
924
0407 023B 27 F6                      BEQ  OUTTE1
925
0408 023D 8D B8                      BSR  ACIRST
926
0409 023F 20 F2                      BRA  OUTTE1
927
0410                         *
928
0411 0241 35 02              OUTTE2  PULS A
929
0412 0243 97 01                      STA ACIAD1
930
0413 0245 39                         RTS
931
0414                         *
932
0415                         * Print Data
933
0416                         *
934
0417 0246 8D E9              PDATA0  BSR  OUTTER
935
0418 0248 A6 80              PDATA1  LDA  ,X+
936
0419 024A 81 04                      CMPA #$04
937
0420 024C 26 F8                      BNE  PDATA0
938
0421 024E 39                         RTS
939
0422                         *
940
0423                         *
941
0424                         ** 'UX' Xmodem IDE Disk upload
942
0425                         *
943
0426 024F 0D 0A              UXMES0  FCB $0D,$0A
944
0427 0251 58 6D 6F 64 65 6D          FCC 'Xmodem IDE Disk Upload'
945
          20 49 44 45 20 44
946
          69 73 6B 20 55 70
947
          6C 6F 61 64
948
0428 0267 04                         FCB 4
949
0429 0268 0D 0A              UXMES1  FCB $0D,$0A
950
0430 026A 55 70 6C 6F 61 64          FCC 'Upload Complete'
951
          20 43 6F 6D 70 6C
952
          65 74 65
953
0431 0279 04                         FCB 4
954
0432 027A 0D 0A              UXMES2  FCB $0D,$0A
955
0433 027C 55 70 6C 6F 61 64          FCC 'Upload Error'
956
          20 45 72 72 6F 72
957
0434 0288 04                         FCB 4
958
0435 0289 0D 0A              UXMSG3  FCB $0D,$0A
959
0436 028B 44 72 69 76 65 20          FCC 'Drive Number :'
960
          4E 75 6D 62 65 72
961
          20 3A
962
0437 0299 04                         FCB 4
963
0438 029A 0D 0A              UXMSG4  FCB $0D,$0A
964
0439 029C 41 72 65 20 59 6F          FCC 'Are You Sure ? (Y/N)'
965
          75 20 53 75 72 65
966
          20 3F 20 28 59 2F
967
          4E 29
968
0440 02B0 04                         FCB 4
969
0441                         *
970
0442                         * Print Banner
971
0443                         *
972
0444 02B1 8E 02 4F           UXSUB   LDX #UXMES0
973
0445 02B4 17 FF 91                   LBSR PDATA1
974
0446                         *
975
0447                         * Prompt for Disk drive number (0 to 3)
976
0448                         *
977
0449 02B7 8E 02 89                   LDX #UXMSG3
978
0450 02BA 17 FF 8B                   LBSR PDATA1
979
0451 02BD 17 FF 40           UXSUB1  LBSR INTER
980
0452 02C0 29 FB                      BVS  UXSUB1
981
0453 02C2 17 FF 6C                   LBSR OUTTER
982
0454 02C5 81 30                      CMPA #'0
983
0455 02C7 10 25 01 2E                LBLO UXEXIT
984
0456 02CB 81 33                      CMPA #'3
985
0457 02CD 10 22 01 28                LBHI UXEXIT
986
0458 02D1 80 30                      SUBA #'0
987
0459 02D3 B7 01 00                   STA  DRVNUM
988
0460                         *
989
0461                         * Report selected drive
990
0462                         *
991
0463 02D6 8E 02 89                   LDX #UXMSG3
992
0464 02D9 17 FF 6C                   LBSR PDATA1
993
0465 02DC B6 01 00                   LDA  DRVNUM
994
0466 02DF 8B 30                      ADDA #'0
995
0467 02E1 17 FF 4D                   LBSR OUTTER
996
0468                         *
997
0469                         * Ask for confirmation (Y/N)
998
0470                         *
999
0471 02E4 8E 02 9A                   LDX #UXMSG4
1000
0472 02E7 17 FF 5E                   LBSR PDATA1
1001
0473 02EA 17 FF 13           UXSUB2  LBSR INTER
1002
0474 02ED 29 FB                      BVS  UXSUB2
1003
0475 02EF 17 FF 3F                   LBSR OUTTER
1004
0476 02F2 84 5F                      ANDA #$5F
1005
0477 02F4 81 4E                      CMPA #'N
1006
0478 02F6 10 27 00 FF                LBEQ UXEXIT
1007
0479 02FA 81 59                      CMPA #'Y
1008
0480 02FC 26 B3                      BNE  UXSUB
1009
0481                         *
1010
0482                         * We have confirmation ... now load the disk image
1011
0483                         *
1012
0484 02FE 17 01 B1                   LBSR INITDR
1013
0485 0301 CE 04 22                   LDU  #XSTST
1014
0486 0304 FF 01 06                   STU  XSTATE
1015
0487 0307 86 01                      LDA  #1
1016
0488 0309 B7 01 04                   STA  BLKNUM
1017
0489                         *
1018
0490                         * Sector1
1019
0491                         *
1020
0492 030C 8E 02 00                   LDX  #BUFFER
1021
0493                         *
1022
0494 030F 4F                         CLRA         TRACK 0
1023
0495 0310 C6 01                      LDB  #$01    SECTOR 1
1024
0496 0312 B7 01 01                   STA  TRACK
1025
0497 0315 F7 01 02                   STB  SECTOR
1026
0498                         *
1027
0499 0318 17 00 EA                   LBSR XREAD
1028
0500 031B 10 25 00 E0                LBCS UXERR
1029
0501 031F 17 01 87                   LBSR XACK
1030
0502 0322 17 00 E0                   LBSR XREAD
1031
0503 0325 10 25 00 D6                LBCS UXERR
1032
0504                         *
1033
0505 0329 8E 02 00                   LDX  #BUFFER
1034
0506 032C B6 01 01                   LDA  TRACK
1035
0507 032F F6 01 02                   LDB  SECTOR
1036
0508 0332 17 01 D5                   LBSR WRITSC
1037
0509 0335 17 01 71                   LBSR XACK
1038
0510                         *
1039
0511                         * Sector 2
1040
0512                         *
1041
0513 0338 8E 02 00                   LDX  #BUFFER
1042
0514                         *
1043
0515 033B B6 01 01                   LDA  TRACK
1044
0516 033E F6 01 02                   LDB  SECTOR
1045
0517 0341 5C                         INCB
1046
0518 0342 B7 01 01                   STA  TRACK
1047
0519 0345 F7 01 02                   STB  SECTOR
1048
0520                         *
1049
0521 0348 17 00 BA                   LBSR XREAD
1050
0522 034B 10 25 00 B0                LBCS UXERR
1051
0523 034F 17 01 57                   LBSR XACK
1052
0524 0352 17 00 B0                   LBSR XREAD
1053
0525 0355 10 25 00 A6                LBCS UXERR
1054
0526                         *
1055
0527 0359 8E 02 00                   LDX  #BUFFER
1056
0528 035C B6 01 01                   LDA  TRACK
1057
0529 035F F6 01 02                   LDB  SECTOR
1058
0530 0362 17 01 A5                   LBSR WRITSC
1059
0531                         *
1060
0532 0365 17 01 41                   LBSR XACK
1061
0533                         *
1062
0534                         * Sector 3 - SIR
1063
0535                         *
1064
0536 0368 8E 02 00                   LDX  #BUFFER
1065
0537                         *
1066
0538 036B B6 01 01                   LDA  TRACK
1067
0539 036E F6 01 02                   LDB  SECTOR
1068
0540 0371 5C                         INCB
1069
0541 0372 B7 01 01                   STA  TRACK
1070
0542 0375 F7 01 02                   STB  SECTOR
1071
0543                         *
1072
0544 0378 17 00 8A                   LBSR XREAD
1073
0545 037B 10 25 00 80                LBCS UXERR
1074
0546 037F 17 01 27                   LBSR XACK
1075
0547 0382 17 00 80                   LBSR XREAD
1076
0548 0385 10 25 00 76                LBCS UXERR
1077
0549                         *
1078
0550 0389 8E 02 00                   LDX  #BUFFER
1079
0551 038C A6 88 26                   LDA  38,X
1080
0552 038F 4C                         INCA
1081
0553 0390 B7 01 0B                   STA  MAXTRK
1082
0554 0393 E6 88 27                   LDB  39,X
1083
0555 0396 5C                         INCB
1084
0556 0397 F7 01 0C                   STB  MAXSEC
1085
0557 039A B6 01 01                   LDA  TRACK
1086
0558 039D F6 01 02                   LDB  SECTOR
1087
0559 03A0 17 01 67                   LBSR WRITSC
1088
0560                         *
1089
0561 03A3 17 01 03                   LBSR XACK
1090
0562                         *
1091
0563                         * Sector 4 to Last Track & Sector
1092
0564                         *
1093
0565                         *
1094
0566 03A6 B6 01 01                   LDA  TRACK
1095
0567 03A9 F6 01 02                   LDB  SECTOR
1096
0568 03AC 5C                         INCB
1097
0569                         *
1098
0570 03AD 8E 02 00           UXLOOP  LDX  #BUFFER
1099
0571 03B0 B7 01 01                   STA  TRACK
1100
0572 03B3 F7 01 02                   STB  SECTOR
1101
0573                         *
1102
0574 03B6 17 00 4C                   LBSR XREAD
1103
0575 03B9 10 25 00 42                LBCS UXERR
1104
0576 03BD 17 00 E9                   LBSR XACK
1105
0577 03C0 17 00 42                   LBSR XREAD
1106
0578 03C3 10 25 00 38                LBCS UXERR
1107
0579                         *
1108
0580 03C7 8E 02 00                   LDX  #BUFFER
1109
0581 03CA B6 01 01                   LDA  TRACK
1110
0582 03CD F6 01 02                   LDB  SECTOR
1111
0583 03D0 17 01 37                   LBSR WRITSC
1112
0584 03D3 17 00 D3                   LBSR XACK
1113
0585                         *
1114
0586 03D6 B6 01 01                   LDA  TRACK
1115
0587 03D9 F6 01 02                   LDB  SECTOR
1116
0588 03DC 5C                         INCB
1117
0589 03DD F1 01 0C                   CMPB MAXSEC
1118
0590 03E0 26 CB                      BNE  UXLOOP
1119
0591 03E2 C6 01                      LDB  #1
1120
0592 03E4 4C                         INCA
1121
0593 03E5 B1 01 0B                   CMPA MAXTRK
1122
0594 03E8 26 C3                      BNE  UXLOOP
1123
0595                         *
1124
0596                         *
1125
0597                         *  Write Boot sector
1126
0598                         *
1127
0599 03EA 8E 07 00                   LDX  #BOOT
1128
0600 03ED 4F                         CLRA         TRACK 0
1129
0601 03EE C6 01                      LDB  #$01    SECTOR 1
1130
0602 03F0 B7 01 01                   STA  TRACK
1131
0603 03F3 F7 01 02                   STB  SECTOR
1132
0604 03F6 17 01 11                   LBSR WRITSC
1133
0605                         *
1134
0606 03F9 8E 02 68           UXEXIT  LDX  #UXMES1
1135
0607 03FC 7E 02 48                   JMP  PDATA1
1136
0608                         *
1137
0609 03FF 8E 02 7A           UXERR   LDX  #UXMES2
1138
0610 0402 16 FE 43                   LBRA PDATA1
1139
0611                         *
1140
0612                         * Get a Byte using XModem protocol
1141
0613                         * Carry clear => no errors
1142
0614                         * Carry set   => errors
1143
0615                         *
1144
0616 0405 34 40              XREAD   PSHS U
1145
0617 0407 FE 01 06                   LDU  XSTATE
1146
0618                         *
1147
0619 040A 17 FD F3           XBYTE0  LBSR INTER
1148
0620 040D 28 0A                      BVC  XBYTE1
1149
0621 040F 86 15                      LDA  #NAK
1150
0622 0411 17 FE 1D                   LBSR OUTTER
1151
0623 0414 CE 04 22                   LDU  #XSTST
1152
0624 0417 20 F1                      BRA  XBYTE0
1153
0625                         *
1154
0626 0419 AD C4              XBYTE1  JSR  ,U
1155
0627 041B 26 ED                      BNE  XBYTE0
1156
0628 041D FF 01 06                   STU  XSTATE
1157
0629 0420 35 C0                      PULS U,PC
1158
0630                         *
1159
0631                         * START - LOOK FOR SOH (START OF HEADER) = $01
1160
0632                         *
1161
0633 0422 81 01              XSTST   CMPA #SOH
1162
0634 0424 26 06                      BNE  XSTST1
1163
0635 0426 CE 04 42                   LDU  #XSTBL
1164
0636 0429 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, no valid data (no exit)
1165
0637 042B 39                         RTS
1166
0638                         *
1167
0639 042C 81 04              XSTST1  CMPA #EOT
1168
0640 042E 26 08                      BNE  XSTST2
1169
0641 0430 86 06                      LDA  #ACK
1170
0642 0432 17 FD FC                   LBSR OUTTER
1171
0643 0435 1A 05                      ORCC  #CFLAG+ZFLAG  Set (c)=1 abort & exit
1172
0644 0437 39                         RTS
1173
0645                         *
1174
0646 0438 81 18              XSTST2  CMPA #CAN
1175
0647 043A 26 03                      BNE  XSTST3
1176
0648 043C 1A 05                      ORCC  #CFLAG+ZFLAG  Set (c)=1 abort & exit
1177
0649 043E 39                         RTS
1178
0650                         *
1179
0651 043F 1C FA              XSTST3  ANDCC #$FF-CFLAG-ZFLAG
1180
0652 0441 39                         RTS
1181
0653                         *
1182
0654                         * Got SOH
1183
0655                         * Now get block number
1184
0656                         *
1185
0657 0442 B1 01 04           XSTBL   CMPA BLKNUM
1186
0658 0445 26 06                      BNE  XSTBLE
1187
0659 0447 CE 04 58                   LDU  #XSTCOM
1188
0660 044A 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1189
0661 044C 39                         RTS
1190
0662                         *
1191
0663                         * Error in block number
1192
0664                         *
1193
0665 044D 86 15              XSTBLE  LDA  #NAK
1194
0666 044F 17 FD DF                   LBSR OUTTER
1195
0667 0452 CE 04 22                   LDU  #XSTST
1196
0668 0455 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1197
0669 0457 39                         RTS
1198
0670                         *
1199
0671                         * Get complement of block number
1200
0672                         *
1201
0673 0458 43                 XSTCOM  COMA
1202
0674 0459 B1 01 04                   CMPA BLKNUM
1203
0675 045C 26 EF                      BNE  XSTBLE
1204
0676 045E 7F 01 03                   CLR  CHKSUM
1205
0677 0461 86 80                      LDA  #128
1206
0678 0463 B7 01 05                   STA  BYTCNT
1207
0679 0466 CE 04 6C                   LDU  #XSTDA
1208
0680 0469 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1209
0681 046B 39                         RTS
1210
0682                         *
1211
0683                         * Get data bytes
1212
0684                         *
1213
0685 046C 34 02              XSTDA   PSHS A
1214
0686 046E BB 01 03                   ADDA CHKSUM
1215
0687 0471 B7 01 03                   STA  CHKSUM
1216
0688 0474 35 02                      PULS A
1217
0689 0476 7A 01 05                   DEC  BYTCNT
1218
0690 0479 26 03                      BNE  XSTDA1
1219
0691 047B CE 04 83                   LDU  #XSTCK
1220
0692 047E A7 80              XSTDA1  STA  ,X+
1221
0693 0480 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, no valid data (no exit)
1222
0694 0482 39                         RTS
1223
0695                         *
1224
0696                         * Byte count reached zero
1225
0697                         * Check checksum byte
1226
0698                         *
1227
0699 0483 B1 01 03           XSTCK   CMPA CHKSUM
1228
0700 0486 26 0B                      BNE  XSTCK1 retry if wrong checksum
1229
0701                         *
1230
0702                         * Checksum OK ...
1231
0703                         * increment block number
1232
0704                         * Don't send ACK until data written to CF
1233
0705                         *
1234
0706 0488 7C 01 04                   INC  BLKNUM
1235
0707 048B CE 04 22                   LDU  #XSTST
1236
0708 048E 1C FE                      ANDCC #$FF-CFLAG No abort
1237
0709 0490 1A 04                      ORCC #ZFLAG      Valid data (exit)
1238
0710 0492 39                         RTS
1239
0711                         *
1240
0712                         * Checksum Error detected ...
1241
0713                         * Reset Sector counter in ACCB to last 128 byte boundary
1242
0714                         * and send NAK
1243
0715                         *
1244
0716 0493 34 04              XSTCK1  PSHS B
1245
0717 0495 1F 10                      TFR  X,D
1246
0718 0497 5A                         DECB
1247
0719 0498 C4 80                      ANDB #128
1248
0720 049A 1F 01                      TFR  D,X
1249
0721 049C 35 04                      PULS B
1250
0722 049E 86 15                      LDA  #NAK
1251
0723 04A0 17 FD 8E           XSTCK2  LBSR OUTTER
1252
0724 04A3 CE 04 22                   LDU  #XSTST
1253
0725 04A6 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, no valid data (no exit)
1254
0726 04A8 39                         RTS
1255
0727                         *
1256
0728                         * Acknowledge Data Received
1257
0729                         *
1258
0730 04A9 34 02              XACK    PSHS A
1259
0731 04AB 86 06                      LDA  #ACK
1260
0732 04AD 17 FD 81                   LBSR OUTTER
1261
0733 04B0 35 82                      PULS A,PC
1262
0734                         *
1263
0735                         *
1264
0736                         ** FLEX 9 IDE DISK DRIVERS
1265
0737                         *
1266
0738                         * FOR SYS09BUG 1.2 ON THE XSA-3S1000
1267
0739                         * WITH I/O MAPPED AT $XE000
1268
0740                         * AND ROM MAPPED AT $XF000
1269
0741                         *
1270
0742                         *
1271
0743                         * INITIALIZE CF CARD FOR 8 BIT LBA MODE
1272
0744                         *
1273
Symbol 'AUXRESET' undefined Pass 20745 04B2 CC 00 00           INITDR LDD #AUXRESET
1274
Symbol 'CF_AUX' undefined Pass 20746 04B5 FD 00 00                  STD CF_AUX
1275
Symbol 'AUXRSTREL' undefined Pass 20747 04B8 CC 00 00                  LDD #AUXRSTREL
1276
Symbol 'CF_AUX' undefined Pass 20748 04BB FD 00 00                  STD CF_AUX
1277
Symbol 'HEADLBA' undefined Pass 20749 04BE CC 00 00                  LDD  #HEADLBA
1278
Symbol 'CF_HEAD' undefined Pass 20750 04C1 FD 00 00                  STD  CF_HEAD
1279
0751 04C4 16 02 E1                  LBRA WTRDY
1280
0752                         *
1281
0753                         * RESTORE DISK DRIVER (SEEK TRACK 00)
1282
0754                         *
1283
0755 04C7 8D 66              RESTR1 BSR   DRVSEL
1284
0756 04C9 4F                        CLRA           ; Track 0
1285
0757 04CA C6 01                     LDB   #$01     ; Sector 1
1286
0758                         *
1287
0759                         * Seek track and sector
1288
0760                         * A holds track number (0 - ??)
1289
0761                         * B holds sector number (1 - ??)
1290
0762                         * Sector numbers starts from 1
1291
0763                         * subtract 1 to start from sector 0 on CF
1292
0764                         *
1293
0765 04CC 34 02              SEEKTS PSHS A
1294
0766 04CE 4F                        CLRA
1295
0767 04CF 5A                        DECB
1296
Symbol 'CF_SECNUM' undefined Pass 20768 04D0 FD 00 00                  STD  CF_SECNUM
1297
0769 04D3 E6 E4                     LDB ,S
1298
Symbol 'CF_CYLLO' undefined Pass 20770 04D5 FD 00 00                  STD  CF_CYLLO
1299
0771 04D8 F6 01 00                  LDB  DRVNUM
1300
Symbol 'CF_CYLHI' undefined Pass 20772 04DB FD 00 00                  STD  CF_CYLHI
1301
0773 04DE C6 01                     LDB  #$01
1302
Symbol 'CF_SECCNT' undefined Pass 20774 04E0 FD 00 00                  STD  CF_SECCNT
1303
0775 04E3 5F                        CLRB
1304
0776 04E4 35 82                     PULS A,PC
1305
0777                         *
1306
0778                         * READ SECTORS FROM CF
1307
0779                         *
1308
0780                         *
1309
0781 04E6 8D E4              READSC BSR  SEEKTS
1310
Symbol 'CMDREAD' undefined Pass 20782 04E8 CC 00 00                  LDD  #CMDREAD ; IDE READ MULTIPLE
1311
Symbol 'CF_COMAND' undefined Pass 20783 04EB FD 00 00                  STD  CF_COMAND
1312
0784 04EE 17 02 B7                  LBSR  WTRDY
1313
0785                         *
1314
0786                         * READ LOOP
1315
0787                         *
1316
0788 04F1 34 20                     PSHS Y
1317
0789 04F3 10 8E 01 00               LDY #256
1318
0790 04F7 17 02 BD           RDLP1  LBSR  WTDRQ
1319
Symbol 'CF_DATA' undefined Pass 20791 04FA FC 00 00                  LDD  CF_DATA
1320
0792 04FD E7 80                     STB  ,X+
1321
0793 04FF 31 3F                     LEAY -1,Y
1322
0794 0501 26 F4                     BNE  RDLP1
1323
0795 0503 35 20                     PULS Y
1324
0796                         *
1325
0797 0505 17 02 A0                  LBSR  WTRDY
1326
0798 0508 5F                        CLRB
1327
0799 0509 39                        RTS
1328
0800                         *
1329
0801                         * WRITE SECTOR TO CF
1330
0802                         *
1331
0803 050A 8D C0              WRITSC BSR  SEEKTS   ; SEEK TRACK & SECTOR
1332
Symbol 'CMDWRITE' undefined Pass 20804 050C CC 00 00                  LDD  #CMDWRITE ; IDE WRITE MULTIPLE
1333
Symbol 'CF_COMAND' undefined Pass 20805 050F FD 00 00                  STD  CF_COMAND
1334
0806 0512 17 02 93                  LBSR  WTRDY
1335
0807                         *
1336
0808                         * WRITE LOOP
1337
0809                         *
1338
0810 0515 34 20                     PSHS Y
1339
0811 0517 10 8E 01 00               LDY #256
1340
0812 051B 4F                        CLRA
1341
0813 051C 17 02 98           WRTLP1 LBSR  WTDRQ
1342
0814 051F E6 80                     LDB  ,X+
1343
Symbol 'CF_DATA' undefined Pass 20815 0521 FD 00 00                  STD  CF_DATA
1344
0816 0524 31 3F                     LEAY -1,Y
1345
0817 0526 26 F4                     BNE  WRTLP1
1346
0818 0528 35 20                     PULS Y
1347
0819                         *
1348
0820 052A 17 02 7B                  LBSR  WTRDY
1349
0821 052D 5F                        CLRB
1350
0822 052E 39                        RTS
1351
0823                         *
1352
0824                         * DRIVE SELECT DISK DRIVER
1353
0825                         *
1354
0826 052F A6 03              DRVSEL LDA   3,X       GET DRIVE # FROM FCB
1355
0827 0531 81 03                     CMPA  #3
1356
0828 0533 23 01                     BLS   DRVS2     IF > 3, SET IT TO 0
1357
0829 0535 4F                        CLRA
1358
0830 0536 B7 01 00           DRVS2  STA   DRVNUM
1359
0831 0539 5F                        CLRB            ; SET Z, CLEAR C
1360
0832 053A 39                        RTS
1361
0833                         *
1362
0834                         * CHECK DRIVE READY DISK DRIVER
1363
0835                         *
1364
0836 053B A6 03              CHKDRV LDA  3,X
1365
0837 053D 5F                        CLRB             ; CLEAR C, SET Z
1366
0838 053E 39                        RTS
1367
0839                         *******************************************************
1368
0840                         *
1369
0841                         * Bootstrap FLEX Loader
1370
0842                         *
1371
0843                         * SBUG1.8 loads the bootstap loader at $C000
1372
0844                         * however the Flex adaption manual has the
1373
0845                         * bootstrap loader residing at $C100
1374
0846                         * Bootstrap Loader is position independent code
1375
0847                         *
1376
0848                         ******************************************************
1377
0849                         *
1378
0850                         * Equates
1379
0851                         *
1380
0852 C0FF                    BSSTACK EQU $C0FF
1381
0853 C300                    SCTBUF  EQU $C300
1382
0854                         *
1383
0855                         * Start of Utility
1384
0856                         *
1385
Symbol 'MONEXT' undefined Pass 20857 0700                            ORG MONEXT+$0700
1386
0858 0700 20 0B              BOOT    BRA BLOAD0
1387
0859 0702 00 00 00                   FCB 0,0,0
1388
0860 0705 00                 TRK     FCB 0        File start track
1389
0861 0706 00                 SCT     FCB 0        File start sector
1390
0862 0707 00                 DNS     FCB 0        Density Flag (not used)
1391
0863 0708 C0 00              TADR    FDB $C000    Transfer address
1392
0864 070A 00 00              LADR    FDB 0        Load Address
1393
0865 070C 00                 DRNUM   FCB 0        Drive number 0
1394
0866                         *
1395
0867 070D 10 CE C0 FF        BLOAD0  LDS  #BSSTACK   Set up Bootstrap stack
1396
0868 0711 EC 8C F1                   LDD  TRK,PCR    Set up start track and sector
1397
0869 0714 FD C3 00                   STD  SCTBUF
1398
0870 0717 10 8E C4 00                LDY  #SCTBUF+256
1399
0871                         *
1400
0872                         * Perform actual file load
1401
0873                         *
1402
0874 071B 8D 35              BLOAD1  BSR GETCH    Get acharcater
1403
0875 071D 81 02                      CMPA #$02    Data record hearder ?
1404
0876 071F 27 10                      BEQ  BLOAD2   Skip, is so
1405
0877 0721 81 16                      CMPA #$16    Xfr address hearder ?
1406
0878 0723 26 F6                      BNE BLOAD1    Loop if neither
1407
0879                         *
1408
0880                         * Get transfer address
1409
0881                         *
1410
0882 0725 8D 2B                      BSR  GETCH
1411
0883 0727 A7 8C DE                   STA  TADR,PCR
1412
0884 072A 8D 26                      BSR  GETCH
1413
0885 072C A7 8C DA                   STA  TADR+1,PCR
1414
0886 072F 20 EA                      BRA  BLOAD1
1415
0887                         *
1416
0888                         * Load data record
1417
0889                         *
1418
0890 0731 8D 1F              BLOAD2 BSR  GETCH  Get load address
1419
0891 0733 A7 8C D4                  STA  LADR,PCR
1420
0892 0736 8D 1A                     BSR  GETCH
1421
0893 0738 A7 8C D0                  STA  LADR+1,PCR
1422
0894 073B 8D 15                     BSR  GETCH  Get Bytes count
1423
0895 073D 1F 89                     TFR  A,B
1424
0896 073F 5D                        TSTB
1425
0897 0740 27 D9                     BEQ  BLOAD1 Loop if count = 0
1426
0898 0742 AE 8C C5                  LDX  LADR,PCR  Get load address
1427
0899 0745 34 14              BLOAD3 PSHS B,X
1428
0900 0747 8D 09                     BSR  GETCH  Get data character
1429
0901 0749 35 14                     PULS B,X
1430
0902 074B A7 80                     STA  ,X+    Store at load address
1431
0903 074D 5A                        DECB
1432
0904 074E 26 F5                     BNE  BLOAD3  Loop until count = 0
1433
0905 0750 20 C9                     BRA  BLOAD1
1434
0906                         *
1435
0907                         * Get Character routine
1436
0908                         * Reads a sector if needed
1437
0909                         *
1438
0910 0752 10 8C C4 00        GETCH  CMPY #SCTBUF+256 out of data ?
1439
0911 0756 26 0F                     BNE  GETCH4      Go read Character if not
1440
0912 0758 8E C3 00           GETCH2 LDX  #SCTBUF     Point to buffer
1441
0913 075B EC 84                     LDD  0,X         Get forward Link
1442
0914 075D 27 0B                     BEQ  GOFLEX      if zero, file is loaded
1443
0915 075F 8D 26                     BSR  READ        Read next sector
1444
0916 0761 26 9D                     BNE  BOOT        start over if error
1445
0917 0763 10 8E C3 04               LDY  #SCTBUF+4   Point past link
1446
0918 0767 A6 A0              GETCH4 LDA  ,Y+         Else, get a character
1447
0919 0769 39                        RTS
1448
0920                         *
1449
0921                         * File is loaded, Jump to it
1450
0922                         *
1451
0923 076A 6E 9C 9B           GOFLEX JMP  [TADR,PCR]      Jump to transfer address
1452
0924
1453
0925                         *
1454
0926                         ** FLEX 9 IDE DISK DRIVERS
1455
0927                         *
1456
0928                         * Seek track and sector
1457
0929                         * A holds track number (0 - ??)
1458
0930                         * B holds sector number (1 - ??)
1459
0931                         * Sector numbers starts from 1
1460
0932                         * subtract 1 to start from sector 0 on CF
1461
0933                         *
1462
0934 076D 34 02              SEEK   PSHS A
1463
0935 076F 4F                        CLRA
1464
0936 0770 5A                        DECB
1465
Symbol 'CF_SECNUM' undefined Pass 20937 0771 FD 00 00                  STD  CF_SECNUM
1466
0938 0774 E6 E4                     LDB  ,S
1467
Symbol 'CF_CYLLO' undefined Pass 20939 0776 FD 00 00                  STD  CF_CYLLO
1468
0940 0779 E6 8C 90                  LDB  DRNUM,PCR
1469
Symbol 'CF_CYLHI' undefined Pass 20941 077C FD 00 00                  STD  CF_CYLHI
1470
0942 077F C6 01                     LDB  #$01
1471
Symbol 'CF_SECCNT' undefined Pass 20943 0781 FD 00 00                  STD  CF_SECCNT
1472
0944 0784 5F                        CLRB
1473
0945 0785 35 82                     PULS A,PC
1474
0946                         *
1475
0947                         * READ SECTORS FROM CF
1476
0948                         *
1477
0949                         *
1478
0950 0787 8D E4              READ   BSR  SEEK
1479
Symbol 'CMDREAD' undefined Pass 20951 0789 CC 00 00                  LDD  #CMDREAD ; IDE READ MULTIPLE
1480
Symbol 'CF_COMAND' undefined Pass 20952 078C FD 00 00                  STD  CF_COMAND
1481
0953 078F 8D 17                     BSR  WTRDY
1482
0954                         *
1483
0955                         * READ LOOP
1484
0956                         *
1485
0957 0791 34 20                     PSHS Y
1486
0958 0793 10 8E 01 00               LDY #256
1487
0959 0797 8D 1E              READ1  BSR  WTDRQ
1488
Symbol 'CF_DATA' undefined Pass 20960 0799 FC 00 00                  LDD  CF_DATA
1489
0961 079C E7 80                     STB  ,X+
1490
0962 079E 31 3F                     LEAY -1,Y
1491
0963 07A0 26 F5                     BNE  READ1
1492
0964 07A2 35 20                     PULS Y
1493
0965                         *
1494
0966 07A4 8D 02                     BSR  WTRDY
1495
0967 07A6 5F                        CLRB
1496
0968 07A7 39                        RTS
1497
0969                         *
1498
0970                         * WAIT UNTIL READY
1499
0971                         *
1500
Symbol 'CF_STATUS' undefined Pass 20972 07A8 FC 00 00           WTRDY   LDD  CF_STATUS
1501
Symbol 'BUSY' undefined Pass 20973 07AB C5 00                      BITB #BUSY
1502
0974 07AD 26 F9                      BNE  WTRDY
1503
Symbol 'CF_STATUS' undefined Pass 20975 07AF FC 00 00                   LDD  CF_STATUS
1504
Symbol 'DRDY' undefined Pass 20976 07B2 C5 00                      BITB #DRDY
1505
0977 07B4 27 F2                      BEQ  WTRDY
1506
0978 07B6 39                         RTS
1507
0979                         *
1508
0980                         * WAIT FOR DATA REQUEST
1509
0981                         *
1510
Symbol 'CF_STATUS' undefined Pass 20982 07B7 FC 00 00           WTDRQ   LDD  CF_STATUS
1511
Symbol 'DRQ' undefined Pass 20983 07BA C5 00                      BITB #DRQ
1512
0984 07BC 27 F9                      BEQ  WTDRQ
1513
0985 07BE 39                         RTS
1514
0986                         *
1515
0004                                END
1516
0000                          INCLUDE "sys09bug.asm"
1517
0001                         * NAM SYS09BUG12 SYSTEM09 MONITOR
1518
0002                          OPT l
1519
 
1520
 
1521
sys09bug.asm                                                                      page   3
1522
0004                         *
1523
0005                         * MONITOR PROGRAM FOR THE SOUTHWEST TECHNICAL
1524
0006                         * PRODUCTS MP-09 CPU BOARD AS COMMENTED BY....
1525
0007                         *
1526
0008                         * ALLEN CLARK            WALLACE WATSON
1527
0009                         * 2502 REGAL OAKS LANE   4815 EAST 97th AVE.
1528
0010                         * LUTZ, FLA. 33549       TEMPLE TERRACE, FLA. 33617
1529
0011                         * PH. 813-977-0347       PH. 813-985-1359
1530
0012                         *
1531
0013                         * MODIFIED TO SBUG09 VER 1.8 BY:  RANDY JARRETT
1532
0014                         *                                 2561 NANTUCKET DR APT. E
1533
0015                         *                                 ATLANTA, GA  30345
1534
0016                         *                                 PH. 404-320-1043
1535
0017                         *
1536
0018                         * MODIFIED TO SYS09BUG VER 1.0
1537
0019                         * FOR:     SYSTEM09 FPGA SYSTEM
1538
0020                         * BY:      JOHN KENT
1539
0021                         * DATE:    21ST NOVEMBER 2006
1540
0022                         * REMOVED: DISK BOOTS
1541
0023                         *          MEMORY TEST
1542
0024                         * ADDED:   ADM3A VDU DRIVER
1543
0025                         *
1544
0026                         * MODIFIED TO SYS09BUG VER 1.1
1545
0027                         * BY:      JOHN KENT
1546
0028                         * DATE:    7TH JANUARY 2007
1547
0029                         * ADDED:   'U' USER EXTENTION COMMANDS AT $F000
1548
0030                         *          CONDITIONAL ASSEMBLY OF FLOPPY BOOTS
1549
0031                         *          AND REALTIME CLOCK
1550
0032                         *
1551
0033                         * MODIFIED TO SYS09BUG VER 1.2
1552
0034                         * BY:      JOHN KENT
1553
0035                         * DATE:    21ST MAY 2007
1554
0036                         * ADDED:   COMPACT FLASH BOOT TO FPGA VERSION
1555
0037                         *          REMOVED PORT REDIRECTION ON PUNCH & LOAD
1556
0038                         *
1557
0039                         * Modified to SYS09BUG VER 1.3
1558
0040                         * BY:      JOHN KENT
1559
0041                         * DATE:    8TH JAN 2008
1560
0042                         * ADDED:   CONDITIONALS FOR SPARTAN3E STARTER BOARD
1561
0043                         *          WITH ONLY 32K OF RAM
1562
0044                         *
1563
0045                         * Modified to SYS09BUG VER 1.4
1564
0046                         * BY:      JOHN KENT
1565
0047                         * DATE:    3RD FEB 2008
1566
0048                         * ADDED:   CONDITIONALS FOR XESS BOARD WITH IDE
1567
0049                         *          SEPERATE CONDITIONAL FOR S3 STARTER AND B5-X300
1568
0050                         *          16 BIT IDE DISK BOOT STRAP ROUTINE
1569
0051                         *
1570
0052                         * Modified to SYS09BUG VER 1.5
1571
0053                         * BY:      JOHN KENT
1572
0054                         * DATE:    7TH SEP 2008
1573
0055                         * ADDED:   ADDED "B3-S2+" STRING
1574
0056                         *
1575
0057                         * Modified to SYS09BUG VER 1.6
1576
0058                         * BY:      JOHN KENT
1577
0059                         * DATE:    2ND DEC 2008
1578
0060                         * ADDED:   ADDED HARDWARE FLOW CONTROL
1579
0061                         *
1580
0062                         * CHANGED: SEPARARTED OPTIONS EQUATES AND BODY INTO SEPARATE FILES
1581
0063                         *
1582
0064                         * Modified to SYS09BUG VER 1.7
1583
0065                         * BY:     JOHN KENT
1584
0066                         * DATE:   16TH OCT 2010
1585
0067                         * ADDED:  "DE2-70" STRING
1586
0068                         *
1587
0069                         *       *** COMMANDS ***
1588
0070                         *
1589
0071                         * CONTROL A   = ALTER THE "A" ACCUMULATOR
1590
0072                         * CONTROL B   = ALTER THE "B" ACCUMULATOR
1591
0073                         * CONTROL C   = ALTER THE CONDITION CODE REGISTER
1592
0074                         * CONTROL D   = ALTER THE DIRECT PAGE REGISTER
1593
0075                         * CONTROL P   = ALTER THE PROGRAM COUNTER
1594
0076                         * CONTROL U   = ALTER USER STACK POINTER
1595
0077                         * CONTROL X   = ALTER "X" INDEX REGISTER
1596
0078                         * CONTROL Y   = ALTER "Y" INDEX REGISTER
1597
0079                         * B hhhh      = SET BREAKPOINT AT LOCATION $hhhh
1598
0080                         * D           = 5.25" MINIFLOPPY BOOT
1599
0081                         * E ssss-eeee = EXAMINE MEMORY
1600
0082                         *               FROM STARTING ADDRESS ssss
1601
0083                         *               TO ENDING ADDRESS eeee.
1602
0084                         * G           = CONTINUE EXECUTION FROM BREAKPOINT OR SWI
1603
0085                         * L           = LOAD TAPE
1604
0086                         * M hhhh      = EXAMINE AND CHANGE MEMORY LOCATION hhhh
1605
0087                         * P ssss-eeee = PUNCH TAPE, START ssss TO END eeee ADDR.
1606
0088                         * R           = DISPLAY REGISTER CONTENTS
1607
0089                         * S           = DISPLAY STACK FROM ssss TO $DFC0
1608
0090                         * U           = 8" DMAF2 FLOPPY BOOT
1609
0091                         * U           = USER EXTENSION COMMANDS AT $F000
1610
0092                         * X           = REMOVE ALL BREAKPOINTS
1611
0093                         *
1612
0094                         *
1613
0095                         ***************************************************
1614
0096                         *   SYS09BUG VARIABLE SPACE
1615
0097                         ***************************************************
1616
0098                         *
1617
0099 DFC0                            ORG   MONRAM
1618
0100 DFC0                    STACK   EQU   *         ; TOP OF INTERNAL STACK
1619
0101 DFC0                    NMI     RMB   2         ; USER NMI VECTOR
1620
0102 DFC2                    SWI3    RMB   2         ; SOFTWARE INTERRUPT VECTOR #3
1621
0103 DFC4                    SWI2    RMB   2         ; SOFTWARE INTERRUPT VECTOR #2
1622
0104 DFC6                    FIRQ    RMB   2         ; FAST INTERRUPT VECTOR
1623
0105 DFC8                    IRQ     RMB   2         ; INTERRUPT VECTOR
1624
0106 DFCA                    SWI     RMB   2         ; SOFTWARE INTERRUPT VECTOR
1625
0107 DFCC                    SVCVO   RMB   2         ; SUPERVISOR CALL VECTOR ORGIN
1626
0108 DFCE                    SVCVL   RMB   2         ; SUPERVISOR CALL VECTOR LIMIT
1627
0109                                 IFD DATOPT
1628
0110                         LRARAM  RMB  16         ; LRA ADDRESSES
1629
0111                                 ENDIF DATOPT
1630
0111                                 ENDIF DATOPT
1631
0112 DFD0                    CPORT   RMB   2         ; RE-VECTORABLE CONTROL PORT
1632
0113 DFD2                    ECHO    RMB   1         ; ECHO FLAG
1633
0114 DFD3                    BPTBL   RMB  24         ; BREAKPOINT TABLE BASE ADDR
1634
0115                                 IFD  TRAOPT
1635
0116                         NMISAV  RMB   2         ; NMI Jump Vector Backup
1636
0117                         TRACNT  RMB   2         ; Trace Count
1637
0118                                 ENDIF TRAOPT
1638
0118                                 ENDIF TRAOPT
1639
0119                                 IFD VDUOPT
1640
0120                         *
1641
0121                         **************************************************
1642
0122                         *   VDU8 DISPLAY DRIVER VARIABLES                                    *
1643
0123                         **************************************************
1644
0124                         *
1645
0125                         **** ALWAYS KEEP COLADX AND ROWADX TOGETHER ******
1646
0126                         COLADX  RMB   1         ; CURSOR COLUMN
1647
0127                         ROWADX  RMB   1         ; CURSOR ROW
1648
0128                         **************************************************
1649
0129                         *
1650
0130                         NEWROW  RMB   1         ; NEW ROW TEMP FOR ESCAPE
1651
0131                         ESCFLG  RMB   1         ; ESCAPE SEQUENCE ACTIVE
1652
0132                                 ENDIF VDUOPT
1653
0132                                 ENDIF VDUOPT
1654
0133                                 IFD DG640OPT
1655
0134                         *
1656
0135                         ***************************************************
1657
0136                         *   DG640 MEMORY MAPPED DISPLAY DRIVER VARIABLES  *
1658
0137                         ***************************************************
1659
0138                         *
1660
0139                         ***** ALWAYS KEEP THESE TWO BYTES TOGETHER *****
1661
0140                         COLADX  RMB   1        ; CURSOR COLUMN
1662
0141                         ROWADX  RMB   1        ; CURSOR ROW
1663
0142                         *************************************************
1664
0143                         CURSOR  RMB   2        ; ABSOLUTE SCREEN ADDRESS
1665
0144                         NEWROW  RMB   1        ; NEW ROW TEMP FOR ESCAPE
1666
0145                         ESCFLG  RMB   1        ; ESCAPE SEQUENCE ACTIVE
1667
0146                                 ENDIF DG640OPT
1668
0146                                 ENDIF DG640OPT
1669
0147                         *
1670
0148                         *
1671
0149                         ***************************************************
1672
0150                         *   START OF ROM                                  *
1673
0151                         ***************************************************
1674
0152                         *
1675
0153 F800                            ORG   MONROM
1676
0154 F800 F8 14                      FDB   MONITOR
1677
0155 F802 F8 48                      FDB   NEXTCMD
1678
0156 F804 FC 04                      FDB   INCH
1679
0157 F806 FB FE                      FDB   INCHE
1680
0158 F808 FC 13                      FDB   INCHEK
1681
0159 F80A FC 21                      FDB   OUTCH
1682
0160 F80C FA F6                      FDB   PDATA
1683
0161 F80E FA 85                      FDB   PCRLF
1684
0162 F810 FA 81                      FDB   PSTRNG
1685
0163 F812 FC F9                      FDB   LRA
1686
0164                         *
1687
0165                                 IFD   ADSOPT
1688
0166                                 FDB   PCHK     ; CHECK FOR PRINTER INPUT
1689
0167                                 FDB   PINIZ    ; INITIATE PRINTER
1690
0168                                 FDB   POUTCH   ; OUTPUT CH. TO PRINTER
1691
0169                                 FDB   VINIZ
1692
0170                                 FDB   VOUTCH
1693
0171                                 FDB   ACINIZ
1694
0172                                 FDB   AOUTCH
1695
0173                                 ENDIF ADSOPT
1696
0173                                 ENDIF ADSOPT
1697
0174                         *
1698
0175                         * MONITOR
1699
0176                         *
1700
0177                         * VECTOR ADDRESS STRING IS.....
1701
0178                         * $F8A1-$F8A1-$F8A1-$F8A1-$F8A1-$FAB0-$FFFF-$FFFF
1702
0179                         *
1703
0180 F814 8E FC 7C           MONITOR LDX   #RAMVEC  ; POINT TO VECTOR ADDR. STRING
1704
0181 F817 10 8E DF C0                LDY   #STACK   ; POINT TO RAM VECTOR LOCATION
1705
0182 F81B C6 10                      LDB   #$10     ; BYTES TO MOVE = 16
1706
0183 F81D A6 80              LOOPA   LDA   ,X+      ; GET VECTOR BYTE
1707
0184 F81F A7 A0                      STA   ,Y+      ; PUT VECTORS IN RAM / $DFC0-$DFCF
1708
0185 F821 5A                         DECB           ; SUBTRACT 1 FROM NUMBER OF BYTES TO MOVE
1709
0186 F822 26 F9                      BNE   LOOPA    ; CONTINUE UNTIL ALL VECTORS MOVED
1710
0187                         *
1711
0188                         * CONTENTS     FROM         TO      FUNCTION
1712
0189                         *  $F8A1       $FE40      $DFC0     USER-V
1713
0190                         *  $F8A1       $FE42      $DFC2     SWI3-V
1714
0191                         *  $F8A1       $FE44      $DFC4     SWI2-V
1715
0192                         *  $F8A1       $FE46      $DFC6     FIRQ-V
1716
0193                         *  $F8A1       $FE48      $DFC8     IRQ-V
1717
0194                         *  $FAB0       $FE4A      $DFCA     SWI-V
1718
0195                         *  $FFFF       $FE4C      $DFCC     SVC-VO
1719
0196                         *  $FFFF       $FE4E      $DFCE     SVC-VL
1720
0197                         *
1721
Symbol 'ACIAS' undefined Pass 20198 F824 8E 00 00                   LDX   #ACIAS
1722
0199 F827 BF DF D0                   STX   CPORT    ; STORE ADDR. IN RAM
1723
0200 F82A 17 01 42                   LBSR  XBKPNT   ; CLEAR OUTSTANDING BREAKPOINTS
1724
0201 F82D C6 0C                      LDB   #12      ; CLEAR 12 BYTES ON STACK
1725
0202 F82F 6F E2              CLRSTK  CLR   ,-S
1726
0203 F831 5A                         DECB
1727
0204 F832 26 FB                      BNE   CLRSTK
1728
0205 F834 30 8C DD                   LEAX  MONITOR,PCR  ; SET PC TO SBUG-E ENTRY
1729
0206 F837 AF 6A                      STX   10,S    ; ON STACK
1730
0207 F839 86 D0                      LDA   #$D0    ; PRESET CONDITION CODES ON STACK
1731
0208 F83B A7 E4                      STA   ,S
1732
0209 F83D 1F 43                      TFR   S,U
1733
0210 F83F 17 03 F4                   LBSR  IOINIZ  ; INITIALIZE CONTROL PORT
1734
0211 F842 8E FC 8C                   LDX   #MSG1   ; POINT TO MONITOR MESSAGE
1735
0212 F845 17 02 AE                   LBSR  PDATA   ; PRINT MSG
1736
0213                         *
1737
0214                                 IFD   DATOPT
1738
0215                                 LDX   #LRARAM ; POINT TO LRA RAM STORAGE AREA
1739
0216                                 CLRA  START   ; TOTAL AT ZERO
1740
0217                                 LDB   #13     ; TOTAL UP ALL ACTIVE RAM MEMORY
1741
0218                         FNDREL  TST   B,X     ; TEST FOR RAM AT NEXT LOC.
1742
0219                                 BEQ   RELPAS  ; IF NO RAM GO TO NEXT LOC.
1743
0220                                 ADDA  #4      ; ELSE ADD 4K TO TOTAL
1744
0221                                 DAA           ; ADJ. TOTAL FOR DECIMAL
1745
0222                         RELPAS  DECB          ; SUB. 1 FROM LOCS. TO TEST
1746
0223                                 BPL   FNDREL  ; PRINT TOTAL OF RAM
1747
0224                                 LBSR  OUT2H   ; OUTPUT HEX BYTE AS ASCII
1748
0225                                 LDX   #MSG2   ; POINT TO MSG 'K' CR/LF + 3 NULS
1749
0226                                 LBSR  PDATA   ; PRINT MSG
1750
0227                                 ENDIF DATOPT
1751
0227                                 ENDIF DATOPT
1752
0228                         *
1753
0229                                 IFD   TRAOPT
1754
0230                                 LBSR  TRAINZ
1755
0231                                 ENDIF TRAOPT
1756
0231                                 ENDIF TRAOPT
1757
0232                         *
1758
0233                         ***** NEXTCMD *****
1759
0234                         *
1760
0235 F848 8E FC AD           NEXTCMD LDX  #MSG3   ; POINT TO MSG ">"
1761
0236 F84B 17 02 33                   LBSR PSTRNG  ; PRINT MSG
1762
0237 F84E 17 03 B3                   LBSR INCH    ; GET ONE CHAR. FROM TERMINAL
1763
0238 F851 84 7F                      ANDA #$7F    ; STRIP PARITY FROM CHAR.
1764
0239 F853 81 0D                      CMPA #$0D    ; IS IT CARRIAGE RETURN ?
1765
0240 F855 27 F1                      BEQ  NEXTCMD ; IF CR THEN GET ANOTHER CHAR.
1766
0241 F857 1F 89                      TFR  A,B     ; PUT CHAR. IN "B" ACCUM.
1767
0242 F859 81 20                      CMPA #$20    ; IS IT CONTROL OR DATA CHAR ?
1768
0243 F85B 2C 09                      BGE  PRTCMD  ; IF CMD CHAR IS DATA, PRNT IT
1769
0244 F85D 86 5E                      LDA  #'^     ; ELSE CNTRL CHAR CMD SO...
1770
0245 F85F 17 03 BF                   LBSR OUTCH   ; PRINT "^"
1771
0246 F862 1F 98                      TFR  B,A     ; RECALL CNTRL CMD CHAR
1772
0247 F864 8B 40                      ADDA #$40    ; CONVERT IT TO ASCII LETTER
1773
0248 F866 17 03 B8           PRTCMD  LBSR OUTCH   ; PRNT CMD CHAR
1774
0249 F869 17 03 B3                   LBSR OUT1S   ; PRNT SPACE
1775
0250 F86C C1 60                      CMPB #$60
1776
0251 F86E 2F 02                      BLE  NXTCH0
1777
0252 F870 C0 20                      SUBB #$20
1778
0253                         *
1779
0254                         ***** DO TABLE LOOKUP *****
1780
0255                         *   FOR COMMAND FUNCTIONS
1781
0256                         *
1782
0257 F872 8E FC 49           NXTCH0  LDX  #JMPTAB ; POINT TO JUMP TABLE
1783
0258 F875 E1 80              NXTCHR  CMPB ,X+     ; DOES COMMAND MATCH TABLE ENTRY ?
1784
0259 F877 27 0F                      BEQ  JMPCMD  ; BRANCH IF MATCH FOUND
1785
0260 F879 30 02                      LEAX 2,X     ; POINT TO NEXT ENTRY IN TABLE
1786
0261 F87B 8C FC 7C                   CMPX #TABEND ; REACHED END OF TABLE YET ?
1787
0262 F87E 26 F5                      BNE  NXTCHR  ; IF NOT END, CHECK NEXT ENTRY
1788
0263 F880 8E FC AF                   LDX  #MSG4   ; POINT TO MSG "WHAT?"
1789
0264 F883 17 02 70                   LBSR PDATA   ; PRINT MSG
1790
0265 F886 20 C0                      BRA  NEXTCMD ; IF NO MATCH, PRMPT FOR NEW CMD
1791
0266 F888 AD 94              JMPCMD  JSR  [,X]    ; JUMP TO COMMAND ROUTINE
1792
0267 F88A 20 BC                      BRA  NEXTCMD ; PROMPT FOR NEW COMMAND
1793
0268                         *
1794
0269                         * "G" GO OR CONTINUE
1795
0270                         *
1796
0271 F88C 1F 34              GO      TFR  U,S
1797
0272 F88E 3B                 RTI     RTI
1798
0273                         *
1799
0274                         ***** "M" MEMORY EXAMINE AND CHANGE *****
1800
0275                         *
1801
0276 F88F 17 02 EB           MEMCHG  LBSR IN1ADR  ; INPUT ADDRESS
1802
0277 F892 29 2D                      BVS  CHRTN   ; IF NOT HEX, RETURN
1803
0278 F894 1F 12                      TFR  X,Y     ; SAVE ADDR IN "Y"
1804
0279 F896 8E FC B5           MEMC2   LDX  #MSG5   ; POINT TO MSG " - "
1805
0280 F899 17 01 E5                   LBSR PSTRNG  ; PRINT MSG
1806
0281 F89C 1F 21                      TFR  Y,X     ; FETCH ADDRESS
1807
0282 F89E 17 03 25                   LBSR OUT4H   ; PRINT ADDR IN HEX
1808
0283 F8A1 17 03 7B                   LBSR OUT1S   ; OUTPUT SPACE
1809
0284 F8A4 A6 A4                      LDA  ,Y      ; GET CONTENTS OF CURRENT ADDR.
1810
0285 F8A6 17 03 25                   LBSR OUT2H   ; OUTPUT CONTENTS IN ASCII
1811
0286 F8A9 17 03 73                   LBSR OUT1S   ; OUTPUT SPACE
1812
0287 F8AC 17 02 DE                   LBSR BYTE    ; LOOP WAITING FOR OPERATOR INPUT
1813
0288 F8AF 28 11                      BVC  CHANGE  ; IF VALID HEX GO CHANGE MEM. LOC.
1814
0289 F8B1 81 08                      CMPA #8      ; IS IT A BACKSPACE (CNTRL H)?
1815
0290 F8B3 27 E1                      BEQ  MEMC2   ; PROMPT OPERATOR AGAIN
1816
0291 F8B5 81 18                      CMPA #$18    ; IS IT A CANCEL (CNTRL X)?
1817
0292 F8B7 27 DD                      BEQ  MEMC2   ; PROMPT OPERATOR AGAIN
1818
0293 F8B9 81 5E                      CMPA #'^     ; IS IT AN UP ARROW?
1819
0294 F8BB 27 17                      BEQ  BACK    ; DISPLAY PREVIOUS BYTE
1820
0295 F8BD 81 0D                      CMPA #$D     ; IS IT A CR?
1821
0296 F8BF 26 0F                      BNE  FORWRD  ; DISPLAY NEXT BYTE
1822
0297 F8C1 39                 CHRTN   RTS          ; EXIT ROUTINE
1823
0298                         *
1824
0299                         *
1825
0300 F8C2 A7 A4              CHANGE  STA  ,Y      ; CHANGE BYTE IN MEMORY
1826
0301 F8C4 A1 A4                      CMPA ,Y      ; DID MEMORY BYTE CHANGE?
1827
0302 F8C6 27 08                      BEQ  FORWRD  ; $F972
1828
0303 F8C8 17 03 54                   LBSR OUT1S   ; OUTPUT SPACE
1829
0304 F8CB 86 3F                      LDA  #'?     ; LOAD QUESTION MARK
1830
0305 F8CD 17 03 51                   LBSR OUTCH   ; PRINT IT
1831
0306 F8D0 31 21              FORWRD  LEAY 1,Y     ; POINT TO NEXT HIGHER MEM LOCATION
1832
0307 F8D2 20 C2                      BRA  MEMC2   ; PRINT LOCATION & CONTENTS
1833
0308 F8D4 31 3F              BACK    LEAY -1,Y    ; POINT TO LAST MEM LOCATION
1834
0309 F8D6 20 BE                      BRA  MEMC2   ; PRINT LOCATION & CONTENTS
1835
0310                         *
1836
0311                         * "S" DISPLAY STACK
1837
0312                         * HEX-ASCII DISPLAY OF CURRENT STACK CONTENTS FROM
1838
0313                         ** CURRENT STACK POINTER TO INTERNAL STACK LIMIT.
1839
0314                         *
1840
0315 F8D8 17 02 22           DISSTK  LBSR PRTSP   ; PRINT CURRENT STACK POINTER
1841
0316 F8DB 1F 32                      TFR  U,Y
1842
0317 F8DD 8E DF C0                   LDX  #STACK  ; LOAD INTERNAL STACK AS UPPER LIMIT
1843
0318 F8E0 30 1F                      LEAX -1,X    ; POINT TO CURRENT STACK
1844
0319 F8E2 20 05                      BRA  MDUMP1  ; ENTER MEMORY DUMP OF STACK CONTENTS
1845
0320                         *
1846
0321                         * "E" DUMP MEMORY FOR EXAMINE IN HEX AND ASCII
1847
0322                         * AFTER CALLING 'IN2ADR' LOWER ADDRESS IN Y-REG.
1848
0323                         *                        UPPER ADDRESS IN X-REG.
1849
0324                         * IF HEX ADDRESSES ARE INVALID (V)=1.
1850
0325                         *
1851
0326 F8E4 17 02 8B           MEMDUMP LBSR IN2ADR  ; INPUT ADDRESS BOUNDRIES
1852
0327 F8E7 29 06                      BVS  EDPRTN  ; NEW COMMAND IF ILLEGAL HEX
1853
0328 F8E9 34 20              MDUMP1  PSHS Y       ; COMPARE LOWER TO UPPER BOUNDS
1854
0329 F8EB AC E1                      CMPX ,S++    ; LOWER BOUNDS > UPPER BOUNDS?
1855
0330 F8ED 24 01                      BCC  AJDUMP  ; IF NOT, DUMP HEX AND ASCII
1856
0331 F8EF 39                 EDPRTN  RTS          ;
1857
0332                         *
1858
0333                         * ADJUST LOWER AND UPPER ADDRESS LIMITS
1859
0334                         * TO EVEN 16 BYTE BOUNDRIES.
1860
0335                         *
1861
0336                         * IF LOWER ADDR = $4532
1862
0337                         * LOWER BOUNDS WILL BE ADJUSTED TO = $4530.
1863
0338                         *
1864
0339                         * IF UPPER ADDR = $4567
1865
0340                         * UPPER BOUNDS WILL BE ADJUSTED TO = $4570.
1866
0341                         *
1867
0342                         * ENTER WITH LOWER ADDRESS IN X-REG.
1868
0343                         *           -UPPER ADDRESS ON TOP OF STACK.
1869
0344                         *
1870
0345 F8F0 1F 10              AJDUMP  TFR  X,D     ; GET UPPER ADDR IN D-REG
1871
0346 F8F2 C3 00 10                   ADDD #$10    ; ADD 16 TO UPPER ADDRESS
1872
0347 F8F5 C4 F0                      ANDB #$F0    ; MASK TO EVEN 16 BYTE BOUNDRY
1873
0348 F8F7 34 06                      PSHS A,B     ; SAVE ON STACK AS UPPER DUMP LIMIT
1874
0349 F8F9 1F 20                      TFR  Y,D     ; $F9A5 GET LOWER ADDRESS IN D-REG
1875
0350 F8FB C4 F0                      ANDB #$F0    ; MASK TO EVEN 16 BYTE BOUNDRY
1876
0351 F8FD 1F 01                      TFR  D,X     ; PUT IN X-REG AS LOWER DUMP LIMIT
1877
0352 F8FF AC E4              NXTLIN  CMPX ,S      ; COMPARE LOWER TO UPPER LIMIT
1878
0353 F901 27 05                      BEQ  SKPDMP  ; IF EQUAL SKIP HEX-ASCII DUMP
1879
0354 F903 17 03 0D                   LBSR INCHEK  ; CHECK FOR INPUT FROM KEYBOARD
1880
0355 F906 27 03                      BEQ  EDUMP
1881
0356 F908 32 62              SKPDMP  LEAS 2,S     ; READJUST STACK IF NOT DUMPING
1882
0357 F90A 39                         RTS          ;
1883
0358                         *
1884
0359                         * PRINT 16 HEX BYTES FOLLOWED BY 16 ASCII CHARACTERS
1885
0360                         * FOR EACH LINE THROUGHOUT ADDRESS LIMITS.
1886
0361                         *
1887
0362 F90B 34 10              EDUMP   PSHS X       ; PUSH LOWER ADDR LIMIT ON STACK
1888
0363 F90D 8E FC B5                   LDX  #MSG5   ; POINT TO MSG " - "
1889
0364 F910 17 01 6E                   LBSR PSTRNG  ; PRINT MSG
1890
0365 F913 AE E4                      LDX  ,S      ; LOAD LOWER ADDR FROM TOP OF STACK
1891
0366 F915 17 02 AE                   LBSR OUT4H   ; PRINT THE ADDRESS
1892
0367 F918 17 03 02                   LBSR OUT2S   ; 2 SPACES
1893
0368 F91B C6 10                      LDB  #$10    ; LOAD COUNT OF 16 BYTES TO DUMP
1894
0369 F91D A6 80              ELOOP   LDA  ,X+     ; GET FROM MEMORY HEX BYTE TO PRINT
1895
0370 F91F 17 02 AC                   LBSR OUT2H   ; OUTPUT HEX BYTE AS ASCII
1896
0371 F922 17 02 FA                   LBSR OUT1S   ; OUTPUT SPACE
1897
0372 F925 5A                         DECB         ; $F9D1 DECREMENT BYTE COUNT
1898
0373 F926 26 F5                      BNE  ELOOP   ; CONTINUE TIL 16 HEX BYTES PRINTED
1899
0374                         *
1900
0375                         * PRINT 16 ASCII CHARACTERS
1901
0376                         * IF NOT PRINTABLE OR NOT VALID
1902
0377                         * ASCII PRINT A PERIOD (.)
1903
0378 F928 17 02 F2                   LBSR OUT2S   ; 2 SPACES
1904
0379 F92B AE E1                      LDX  ,S++    ; GET LOW LIMIT FRM STACK - ADJ STACK
1905
0380 F92D C6 10                      LDB  #$10    ; SET ASCII CHAR TO PRINT = 16
1906
0381 F92F A6 80              EDPASC  LDA  ,X+     ; GET CHARACTER FROM MEMORY
1907
0382 F931 81 20                      CMPA #$20    ; IF LESS THAN $20, NON-PRINTABLE?
1908
0383 F933 25 04                      BCS  PERIOD  ; IF SO, PRINT PERIOD INSTEAD
1909
0384 F935 81 7E                      CMPA #$7E    ; IS IT VALID ASCII?
1910
0385 F937 23 02                      BLS  PRASC   ; IF SO PRINT IT
1911
0386 F939 86 2E              PERIOD  LDA  #'.     ; LOAD A PERIOD (.)
1912
0387 F93B 17 02 E3           PRASC   LBSR OUTCH   ; PRINT ASCII CHARACTER
1913
0388 F93E 5A                         DECB         ; DECREMENT COUNT
1914
0389 F93F 26 EE                      BNE  EDPASC
1915
0390 F941 20 BC                      BRA  NXTLIN
1916
0391                         *
1917
0392                         ***** "B" SET BREAKPOINT *****
1918
0393                         *
1919
0394 F943 17 02 37           BRKPNT  LBSR IN1ADR  ; GET BREAKPOINT ADDRESS
1920
0395 F946 29 1E                      BVS  EXITBP  ; EXIT IF INVALID HEX ADDR.
1921
0396 F948 8C DF C0                   CMPX #STACK  ; ADDRESS ILLEGAL IF >=$DFC0
1922
0397 F94B 24 1A                      BCC  BPERR   ; IF ERROR PRINT (?), EXIT
1923
0398 F94D 34 10                      PSHS X       ; $FA82 PUSH BP ADDRESS ON STACK
1924
0399 F94F 8E FF FF                   LDX  #$FFFF  ; LOAD DUMMY ADDR TO TEST BP TABLE
1925
0400 F952 8D 55                      BSR BPTEST   ; TEST BP TABLE FOR FREE SPACE
1926
0401 F954 35 10                      PULS X       ; POP BP ADDRESS FROM STACK
1927
0402 F956 27 0F                      BEQ  BPERR   ; (Z) SET, OUT OF BP TABLE SPACE
1928
0403 F958 A6 84                      LDA  ,X      ; GET DATA AT BREAKPOINT ADDRESS
1929
0404 F95A 81 3F                      CMPA #$3F    ; IS IT A SWI?
1930
0405 F95C 27 09                      BEQ  BPERR   ; IF SWI ALREADY, INDICATE ERROR
1931
0406 F95E A7 A0                      STA  ,Y+     ; SAVE DATA BYTE IN BP TABLE
1932
0407 F960 AF A4                      STX  ,Y      ; SAVE BP ADDRESS IN BP TABLE
1933
0408 F962 86 3F                      LDA  #$3F    ; LOAD A SWI ($3F)
1934
0409 F964 A7 84                      STA  ,X      ; SAVE SWI AT BREAKPOINT ADDRESS
1935
0410 F966 39                 EXITBP  RTS ;
1936
0411                         *
1937
0412                         *  INDICATE ERROR SETTING BREAKPOINT
1938
0413                         *
1939
0414 F967 17 02 B5           BPERR   LBSR OUT1S   ; OUTPUT SPACE
1940
0415 F96A 86 3F                      LDA  #'?     ; LOAD (?), INDICATE BREAKPOINT ERROR
1941
0416 F96C 16 02 B2                   LBRA OUTCH   ; PRINT "?"
1942
0417                         *
1943
0418                         *** "X" CLEAR OUTSTANDING BREAKPOINTS ***
1944
0419                         *
1945
0420 F96F 10 8E DF D3        XBKPNT  LDY  #BPTBL  ; POINT TO BREAKPOINT TABLE
1946
0421 F973 C6 08                      LDB  #8      ; LOAD BREAKPOINT COUNTER
1947
0422 F975 8D 18              XBPLP   BSR  RPLSWI  ; REMOVE USED ENTRY IN BP TABLE
1948
0423 F977 5A                         DECB  $FAAC  ; DECREMENT BP COUNTER
1949
0424 F978 26 FB                      BNE  XBPLP   ; END OF BREAKPOINT TABLE?
1950
0425 F97A 39                         RTS
1951
0426                         *
1952
0427                         ***** SWI ENTRY POINT *****
1953
0428                         *
1954
0429 F97B 1F 43              SWIE    TFR  S,U     ; TRANSFER STACK TO USER POINTER
1955
0430 F97D AE 4A                      LDX  10,U    ; LOAD PC FROM STACK INTO X-REG
1956
0431 F97F 30 1F                      LEAX -1,X    ; ADJUST ADDR DOWN 1 BYTE.
1957
0432 F981 8D 26                      BSR  BPTEST  ; FIND BREAKPOINT IN BP TABLE
1958
0433 F983 27 04                      BEQ  REGPR   ; IF FOUND, REPLACE DATA AT BP ADDR
1959
0434 F985 AF 4A                      STX  10,U    ; SAVE BREAKPOINT ADDR IN STACK
1960
0435 F987 8D 06                      BSR  RPLSWI  ; GO REPLACE SWI WITH ORIGINAL DATA
1961
0436 F989 17 01 C8           REGPR   LBSR REGSTR  ; GO PRINT REGISTERS
1962
0437                         *
1963
0438                                 IFD TRAOPT
1964
0439                                 LDX #0
1965
0440                                 STX TRACNT
1966
0441                                 ENDIF TRAOPT
1967
0441                                 ENDIF TRAOPT
1968
0442                         *
1969
0443 F98C 16 FE B9                   LBRA NEXTCMD ; GET NEXT COMMAND
1970
0444                         *
1971
0445 F98F AE 21              RPLSWI  LDX  1,Y     ; LOAD BP ADDRESS FROM BP TABLE
1972
0446 F991 8C DF C0                   CMPX #STACK  ; COMPARE TO TOP AVAILABLE USER MEMORY
1973
0447 F994 24 0A                      BCC  FFSTBL  ; GO RESET TABLE ENTRY TO $FF'S
1974
0448 F996 A6 84                      LDA  ,X      ; GET DATA FROM BP ADDRESS
1975
0449 F998 81 3F                      CMPA #$3F    ; IS IT SWI?
1976
0450 F99A 26 04                      BNE  FFSTBL  ; IF NOT, RESET TABLE ENTRY TO $FF'S
1977
0451 F99C A6 A4                      LDA  ,Y      ; GET ORIGINAL DATA FROM BP TABLE
1978
0452 F99E A7 84                      STA  ,X      ; $FAD3 RESTORE DATA AT BP ADDRESS
1979
0453 F9A0 86 FF              FFSTBL  LDA  #$FF    ; LOAD $FF IN A-ACC
1980
0454 F9A2 A7 A0                      STA  ,Y+     ; RESET BREAKPOINT TABLE DATA TO $FF'S
1981
0455 F9A4 A7 A0                      STA  ,Y+     ; RESET BREAKPOINT TABLE ADDR TO $FF'S
1982
0456 F9A6 A7 A0                      STA  ,Y+
1983
0457 F9A8 39                         RTS
1984
0458                         *
1985
0459                         ** SEARCH BREAKPOINT TABLE FOR MATCH **
1986
0460                         *
1987
0461 F9A9 10 8E DF D3        BPTEST  LDY  #BPTBL  ; POINT TO BREAKPOINT TABLE
1988
0462 F9AD C6 08                      LDB  #8      ; LOAD BREAKPOINT COUNTER
1989
0463 F9AF A6 A0              FNDBP   LDA  ,Y+     ; LOAD DATA BYTE
1990
0464 F9B1 AC A1                      CMPX ,Y++    ; COMPARE ADDRESS, IS IT SAME?
1991
0465 F9B3 27 04                      BEQ  BPADJ   ; IF SO, ADJUST POINTER FOR TABLE ENTRY
1992
0466 F9B5 5A                         DECB         ; IF NOT, DECREMENT BREAKPOINT COUNTER
1993
0467 F9B6 26 F7                      BNE  FNDBP   ; AND LOOK FOR NEXT POSSIBLE MATCH
1994
0468 F9B8 39                         RTS          ;
1995
0469                         *
1996
0470                         *
1997
0471 F9B9 31 3D              BPADJ   LEAY -3,Y    ; MOVE POINTER TO BEGIN OF BP ENTRY
1998
0472 F9BB 39                         RTS
1999
0473                         *
2000
0474                                 IFD TRAOPT
2001
0475                         *
2002
0476                         ** TRACE from address AAAA BB bytes
2003
0477                         *
2004
0478                         TRACE   LBSR ALTPC1  ; SET UP NEW PC
2005
0479                                 BVS  TREXIT  ; ADDRESS ERROR, EXIT
2006
0480                                 LBSR OUT1S
2007
0481                                 LBSR IN1ADR  ; Fetch Byte Count
2008
0482                                 BVS TREXIT   ; Byte Count error, EXIT
2009
0483                                 STX TRACNT
2010
0484                         *
2011
0485                                 LDX NMI      ; Save NMI Vector
2012
0486                                 STX NMISAV
2013
0487                                 LDX #NMIE    ; Set up NMI for Tracing
2014
0488                                 STX NMI
2015
0489                                 LBSR TRAINZ  ; Initialise Hardware
2016
0490                                 BRA TRACEG   ; Start Trace
2017
0491                         TREXIT  RTS
2018
0492                         *
2019
0493                         * CRA0 = 0 CA1 IRQ DISAB, CRA0 = 1 CA1 IRQ ENAB
2020
0494                         * CRA1 = 1 CA1 Rising edge IRQ
2021
0495                         * CRA2 = 0 TADATA = Data Direction, CRA2 = 1 TADATA = I/O Register
2022
0496                         * CRA3 = 0 CA2 = 0 output, CRA3 = 1 CA2 = 1
2023
0497                         * CRA4 = 1 ] CA2 = Set/Reset output
2024
0498                         * CRA5 = 1 ]
2025
0499                         * CRA6 = X CA2 Input Interrupt Flag
2026
0500                         * CRA7 = X CA1 Interrupt Flag
2027
0501                         *
2028
0502                         * CRB0 = 0 CB1 IRQ DISAB, CRB0 = 1 CA1 IRQ ENAB
2029
0503                         * CRB1 = 1 CB1 Rising edge IRQ
2030
0504                         * CRB2 = 0 TBDATA = Data Direction, CRB2 = 1 TBDATA = I/O Register
2031
0505                         * CRB3 = 0 CB2 = 0 output, CRB3 = 1 CB2 = 1
2032
0506                         * CRB4 = 1 ] CB2 = Set/Reset output
2033
0507                         * CRB5 = 1 ]
2034
0508                         * CRB6 = X CB2 Input Interrupt Flag
2035
0509                         * CRB7 = X CB1 Interrupt Flag
2036
0510                         *
2037
0511                         *
2038
0512                         ** TRACE NMI ENTRY POINT
2039
0513                         *
2040
0514                         NMIE    TFR  S,U
2041
0515                                 LDA  #$36    ; Disable Interrupt, CA2 Low
2042
0516                                 STA  TACTRL
2043
0517                                 LDA  TADATA  ; Clear Interrupt flag by reading data port
2044
0518                         *
2045
0519                                 LBSR REGSTR  ; DUMP REGISTERS
2046
0520                         *
2047
0521                                 LDX  10,U    ; TEST IF NEXT INSTRUCTION IS A SWI
2048
0522                                 LDA  ,X
2049
0523                                 CMPA #$3F
2050
0524                                 BEQ  TRACEX  ; EXIT ON SWI
2051
0525                         *
2052
0526                                 LDX  TRACNT  ; CHECK IF TRACE COUNT EXPIRED
2053
0527                                 BEQ  TRACEX  ; YES, GO BACK TO THE MONITOR
2054
0528                                 LEAX -1,X    ; ECREMENT TRACE COUNT
2055
0529                                 STX  TRACNT
2056
0530                         *
2057
0531                         **  TRACE GO (RESUME SINGLE STEP)
2058
0532                         *
2059
0533                         TRACEG  TFR  U,S     ; SET UP PROGRAM STACK POINTER
2060
0534                                 LDA  #TRADEL ; SET UP TIMER DELAY (NUMB CYCLES FOR RTI+1)
2061
0535                                 STA  TADATA
2062
0536                                 LDA  #$36    ; LOAD STROBE LOW
2063
0537                                 STA  TACTRL
2064
0538                                 LDA  TADATA  ; CLEAR INTERRUPT
2065
0539                                 LDA  #$36    ; RELEASE RESET
2066
0540                                 STA  TBCTRL
2067
0541                                 LDA  #$3F    ; RELEASE LOAD, ENABLE CA1 NMI, CA1 RISING EDGE
2068
0542                                 STA  TACTRL
2069
0543                                 RTI          ; GO EXECUTE INSTRUCTION
2070
0544                         *
2071
0545                         TRACEX  LDX NMISAV   ; Restore NMI vector
2072
0546                                 STX NMI
2073
0547                                 LBRA NEXTCMD ; Jump back to the command loop.
2074
0548                         *
2075
0549                         ** TRACE HARDWARE INITIALISATION
2076
0550                         *
2077
0551                         TRAINZ  LDA #$32     ; SELECT DDRA, CA2 LOW, NMI DISABLED
2078
0552                                 STA TACTRL
2079
0553                                 LDA #$3A     ; SELECT DDRB, CB2 HIGH, FIRQ DISABLED
2080
0554                                 STA TBCTRL
2081
0555                                 LDA #$FF     ; PORTA = OUTPUT
2082
0556                                 STA TADATA
2083
0557                                 LDA #$00     ; PORTB = INPUT
2084
0558                                 STA TBDATA
2085
0559                                 LDA #$36     ; SELECT OUTPUT REGISTER A, CA2 LOW
2086
0560                                 STA TACTRL
2087
0561                                 LDA #$3E     ; SELECT OUTPUT REGISTER B, CB2 HIGH
2088
0562                                 STA TBCTRL
2089
0563                                 RTS
2090
0564                         *
2091
0565                                 ENDIF TRAOPT
2092
0565                                 ENDIF TRAOPT
2093
0566                                 IFD  MFDCOPT
2094
0567                         *
2095
0568                         ** "U" MINI DISK BOOT
2096
0569                         *
2097
0570                         MINBOOT TST  CMDFDC
2098
0571                                 CLR  DRVFDC
2099
0572                                 LDX  #$0000
2100
0573                         LOOP    LEAX $01,X
2101
0574                                 CMPX #$0000
2102
0575                                 BNE  LOOP
2103
0576                                 LDA  #$0F
2104
0577                                 STA  CMDFDC
2105
0578                                 BSR  DELAY
2106
0579                         LOOP1   LDB  CMDFDC
2107
0580                                 BITB #$01
2108
0581                                 BNE  LOOP1
2109
0582                                 LDA  #$01
2110
0583                                 STA  SECFDC
2111
0584                                 BSR  DELAY
2112
0585                                 LDA  #$8C
2113
0586                                 STA  CMDFDC
2114
0587                                 BSR  DELAY
2115
0588                                 LDX  #$C000
2116
0589                                 BRA  LOOP3
2117
0590                         LOOP2   BITB #$02
2118
0591                                 BEQ  LOOP3
2119
0592                                 LDA  DATFDC
2120
0593                                 STA ,X+
2121
0594                         LOOP3   LDB  CMDFDC
2122
0595                                 BITB #$01
2123
0596                                 BNE  LOOP2
2124
0597                                 BITB #$2C
2125
0598                                 BEQ  LOOP4
2126
0599                                 RTS
2127
0600                         *
2128
0601                         LOOP4   LDX  #$C000
2129
0602                                 STX  $0A,U
2130
0603                                 TFR  U,S
2131
0604                                 RTI
2132
0605                         *
2133
0606                         DELAY   LDB  #$04
2134
0607                         LOOP5   DECB
2135
0608                                 BNE  LOOP5
2136
0609                                 RTS
2137
0610                                 ENDIF MFDCOPT
2138
0610                                 ENDIF MFDCOPT
2139
0611                         *
2140
0612                                 IFD  DMAFOPT
2141
0613                         *
2142
0614                         *** "D" DISK BOOT FOR DMAF2 ***
2143
0615                         *
2144
0616                         DBOOT   LDA  #$DE
2145
0617                                 STA  DRVREG
2146
0618                                 LDA  #$FF
2147
0619                                 STA  PRIREG  ; $FAF8
2148
0620                                 STA  CCREG
2149
0621                                 STA  AAAREG
2150
0622                                 STA  BBBREG
2151
0623                                 TST  CCREG
2152
0624                                 LDA  #$D8
2153
0625                                 STA  COMREG
2154
0626                                 LBSR DLY
2155
0627                         DBOOT0  LDA  COMREG
2156
0628                                 BMI  DBOOT0
2157
0629                                 LDA  #$09
2158
0630                                 STA  COMREG
2159
0631                                 LBSR DLY
2160
0632                         *
2161
0633                         DISKWT  LDA  COMREG  ; FETCH DRIVE STATUS
2162
0634                                 BITA #1      ; TEST BUSY BIT
2163
0635                                 BNE  DISKWT  ; LOOP UNTIL NOT BUSY
2164
0636                         *
2165
0637                                 BITA #$10
2166
0638                                 BNE  DBOOT
2167
0639                         *
2168
0640                                 LDX  #$C000  ; LOGICAL ADDR. = $C000
2169
0641                                 BSR LRA      ; GET 20 BIT PHYSICAL ADDR. OF LOG. ADDR.
2170
0642                                 ORA  #$10
2171
0643                                 STA  CCCREG
2172
0644                                 TFR  X,D
2173
0645                                 COMA  ;
2174
0646                                 COMB  ;
2175
0647                                 STD  ADDREG
2176
0648                                 LDX  #$FEFF  ; LOAD DMA BYTE COUNT = $100
2177
0649                                 STX  CNTREG  ; STORE IN COUNT REGISTER
2178
0650                                 LDA  #$FF    ; LOAD THE CHANNEL REGISTER
2179
0651                                 STA  CCREG
2180
0652                                 LDA  #$FE    ; SET CHANNEL 0
2181
0653                                 STA  PRIREG
2182
0654                                 LDA  #1      ; SET SECTOR TO "1"
2183
0655                                 STA  SECREG  ; ISSUE COMMAND
2184
0656                                 LDA  #$8C    ; SET SINGLE SECTOR READ
2185
0657                                 STA  COMREG  ; ISSUE COMMAND
2186
0658                                 BSR  DLY
2187
0659                         *
2188
0660                         * THE FOLLOWING CODE TESTS THE STATUS OF THE
2189
0661                         * CHANNEL CONTROL REGISTER. IF "D7" IS NOT
2190
0662                         * ZERO THEN IT WILL LOOP WAITING FOR "D7"
2191
0663                         * TO GO TO ZERO. IF AFTER 65,536 TRIES IT
2192
0664                         * IS STILL A ONE THE BOOT OPERATION WILL
2193
0665                         * BE STARTED OVER FROM THE BEGINING.
2194
0666                         *
2195
0667                                 CLRB         ;
2196
0668                         DBOOT1  PSHS B       ; $FB55
2197
0669                                 CLRB         ;
2198
0670                         DBOOT2  TST  CCREG
2199
0671                                 BPL  DBOOT3
2200
0672                                 DECB  ;
2201
0673                                 BNE  DBOOT2
2202
0674                                 PULS B
2203
0675                                 DECB
2204
0676                                 BNE  DBOOT1
2205
0677                                 BRA  DBOOT
2206
0678                         DBOOT3  PULS B
2207
0679                                 LDA  COMREG
2208
0680                                 BITA #$1C
2209
0681                                 BEQ  DBOOT4
2210
0682                                 RTS  ;
2211
0683                         *
2212
0684                         *
2213
0685                         DBOOT4  LDB  #$DE
2214
0686                                 STB  DRVREG
2215
0687                                 LDX  #$C000
2216
0688                                 STX  10,U
2217
0689                                 TFR  U,S     ; $FB7B
2218
0690                                 RTI  ;
2219
0691                                 ENDIF DMAFOPT
2220
0691                                 ENDIF DMAFOPT
2221
0692                         *
2222
0693                                 IFD CF8OPT
2223
0694                         *
2224
0695                         * COMPACT FLASH BOOT
2225
0696                         *
2226
0697                         CFBOOT  BSR  WAITRDY
2227
0698                                 LDA  #HEADLBA
2228
0699                                 STA  CF_HEAD
2229
0700                                 BSR  WAITRDY
2230
0701                                 LDA  #FEAT8BIT
2231
0702                                 STA  CF_FEATURE
2232
0703                                 LDA  #CMDFEATURE
2233
0704                                 STA  CF_COMAND
2234
0705                                 BSR  WAITRDY
2235
0706                         *
2236
0707                         * READ SECTORS FROM CF
2237
0708                         *
2238
0709                         CFREAD  LDA  #$01
2239
0710                                 STA  CF_SECCNT
2240
0711                                 CLRA
2241
0712                                 STA  CF_SECNUM
2242
0713                                 STA  CF_CYLLO
2243
0714                                 STA  CF_CYLHI
2244
0715                         *
2245
0716                                 LDA  #CMDREAD ; IDE READ MULTIPLE
2246
0717                                 STA  CF_COMAND
2247
0718                                 BSR  WAITRDY
2248
0719                                 LDX  #$C000
2249
0720                         *
2250
0721                         * READ LOOP
2251
0722                         *
2252
0723                         RDLOOP  BSR  WAITDRQ
2253
0724                                 LDA  CF_DATA
2254
0725                                 STA  ,X+
2255
0726                                 CMPX #$C200
2256
0727                                 BNE  RDLOOP
2257
0728                         *
2258
0729                                 LDX  #$C000
2259
0730                                 STX  $0A,U
2260
0731                                 TFR  U,S
2261
0732                                 RTI
2262
0733                         *
2263
0734                         * WAIT UNTIL READY
2264
0735                         *
2265
0736                         WAITRDY LDA  CF_STATUS
2266
0737                                 BITA #BUSY
2267
0738                                 BNE  WAITRDY
2268
0739                                 LDA  CF_STATUS
2269
0740                                 BITA #DRDY
2270
0741                                 BEQ  WAITRDY
2271
0742                                 RTS
2272
0743                         *
2273
0744                         * WAIT FOR DATA REQUEST
2274
0745                         *
2275
0746                         WAITDRQ LDA  CF_STATUS
2276
0747                                 BITA #DRQ
2277
0748                                 BEQ  WAITDRQ
2278
0749                                 RTS
2279
0750                                 ENDIF CF8OPT
2280
0750                                 ENDIF CF8OPT
2281
0751                         *
2282
0752                                 IFD IDEOPT
2283
0753                         *
2284
0754                         * XESS 16 BIT IDE BOOT
2285
0755                         *
2286
0756                         IDEBOOT LDD  #AUXRESET
2287
0757                                 STD  CF_AUX
2288
0758                                 LDD #AUXRSTREL
2289
0759                                 STD CF_AUX
2290
0760                                 LDD  #HEADLBA
2291
0761                                 STD  CF_HEAD
2292
0762                                 BSR  WAITRDY
2293
0763                         *
2294
0764                         * READ SECTORS FROM CF
2295
0765                         *
2296
0766                                 LDD  #$01
2297
0767                                 STD  CF_SECCNT
2298
0768                                 CLRB
2299
0769                                 STD  CF_SECNUM
2300
0770                                 STD  CF_CYLLO
2301
0771                                 STD  CF_CYLHI
2302
0772                         *
2303
0773                                 LDB  #CMDREAD ; IDE READ MULTIPLE
2304
0774                                 STD  CF_COMAND
2305
0775                                 BSR  WAITRDY
2306
0776                                 LDX  #$C000
2307
0777                         *
2308
0778                         * READ LOOP
2309
0779                         *
2310
0780                         RDLOOP  BSR  WAITDRQ
2311
0781                                 LDD  CF_DATA
2312
0782                                 STB  ,X+
2313
0783                                 CMPX #$C100
2314
0784                                 BNE  RDLOOP
2315
0785                         *
2316
0786                                 LDX  #$C000
2317
0787                                 STX  $0A,U
2318
0788                                 TFR  U,S
2319
0789                                 RTI
2320
0790                         *
2321
0791                         * WAIT UNTIL READY
2322
0792                         *
2323
0793                         WAITRDY LDD  CF_STATUS
2324
0794                                 BITB #BUSY
2325
0795                                 BNE  WAITRDY
2326
0796                                 LDD  CF_STATUS
2327
0797                                 BITB #DRDY
2328
0798                                 BEQ  WAITRDY
2329
0799                                 RTS
2330
0800                         *
2331
0801                         * WAIT FOR DATA REQUEST
2332
0802                         *
2333
0803                         WAITDRQ LDD  CF_STATUS
2334
0804                                 BITB #DRQ
2335
0805                                 BEQ  WAITDRQ
2336
0806                                 RTS
2337
0807                                 ENDIF IDEOPT
2338
0807                                 ENDIF IDEOPT
2339
0808                         *
2340
0809                                 IFD RTCOPT
2341
0810                         *
2342
0811                         * CLOCK INTER FACE UTILITY
2343
0812                         *
2344
0813                         * TIME   
2345
0814                         * If no argument is specified, the current time
2346
0815                         * will be displayed.
2347
0816                         *
2348
0817                         * READ A REGISTER FROM THE COUNTER.
2349
0818                         * The X Index rgister points to the register
2350
0819                         * to be read. The Status Register is checked
2351
0820                         * before and after the register is read before
2352
0821                         * returning a value in accumulator A
2353
0822                         *
2354
0823                         RDCLK  TST CLKSTA
2355
0824                                BNE RDCLK
2356
0825                         RDCLK1 LDA 0,X
2357
0826                                TST CLKSTA
2358
0827                                BNE RDCLK1
2359
0828                                RTS
2360
0829                         *
2361
0830                         * MAIN PROGRAM:
2362
0831                         *
2363
0832                         TIMSET LDX #COUNTR    ; POINT TO TIMER
2364
0833                               LBSR BYTE       ; READ HOURS
2365
0834                               BVS  SHOWTM     ; NO ARG, DISP TIME
2366
0835                               STA HOUR,X
2367
0836                               LBSR OUT1S
2368
0837                               LBSR BYTE       ; READ MINUITES
2369
0838                               BVS  SHOWTM
2370
0839                               STA MINUIT,X
2371
0840                               LBSR OUT1S
2372
0841                               LBSR BYTE       ; SECONDS.
2373
0842                               BVS SHOWTM
2374
0843                               STA SECOND,X
2375
0844                         *
2376
0845                         * DISPLAY CURRENT TIME
2377
0846                         *
2378
0847                         SHOWTM LBSR PCRLF
2379
0848                                LDX #COUNTR+HOUR
2380
0849                                LDB #3
2381
0850                         SHOWLP BSR RDCLK
2382
0851                                LBSR OUT2H
2383
0852                                LDA #':
2384
0853                                LBSR OUTCH
2385
0854                                LEAX -1,X
2386
0855                                DECB
2387
0856                                BNE SHOWLP
2388
0857                                RTS
2389
0858                         *
2390
0859                         * INITIATE CLOCK.
2391
0860                         * MASK INTERRUPTS.
2392
0861                         *
2393
0862                         CLKINZ CLR CINTCR     ; MASK ALL INTERRUPTS
2394
0863                                TST CINTSR     ; CLEAR ANY INTERRUPTS
2395
0864                                RTS
2396
0865                                ENDIF RTCOPT
2397
0865                                ENDIF RTCOPT
2398
0866                                IFD DATOPT
2399
0867                         *
2400
0868                         ***** LRA LOAD REAL ADDRESS *****
2401
0869                         *
2402
0870                         * THE FOLLOWING CODE LOADS THE 20-BIT
2403
0871                         * PHYSICAL ADDRESS OF A MEMORY BYTE
2404
0872                         * INTO THE "A" AND "X" REGISTERS. THIS
2405
0873                         * ROUTINE IS ENTERED WITH THE LOGICAL
2406
0874                         * ADDRESS OF A MEMORY BYTE IN THE "IX"
2407
0875                         * REGISTER. EXIT IS MADE WITH THE HIGH-
2408
0876                         * ORDER FOUR BITS OF THE 20-BIT PHYSICAL
2409
0877                         * ADDRESS IN THE "A" REGISTER, AND THE
2410
0878                         * LOW-ORDER 16-BITS OF THE 20-BIT
2411
0879                         * PHYSICAL ADDRESS IN THE "IX" REGISTER.
2412
0880                         * ALL OTHER REGISTERS ARE PRESERVED.
2413
0881                         * THIS ROUTINE IS REQUIRED SINCE THE
2414
0882                         * DMAF1 AND DMAF2 DISK CONTROLLERS MUST
2415
0883                         * PRESENT PHYSICAL ADDRESSES ON THE
2416
0884                         * SYSTEM BUS.
2417
0885                         *
2418
0886                         LRA     PSHS A,B,X,Y  ; PUSH REGISTERS ON STACK
2419
0887                                 LDA  2,S      ; GET MSB LOGICAL ADDR FRM X REG ON STACK
2420
0888                                 LSRA          ;
2421
0889                                 LSRA          ; ADJ FOR INDEXED INTO
2422
0890                                 LSRA          ; CORRESPONDING LOCATION
2423
0891                                 LSRA          ; IN LRA TABLE
2424
0892                                 LDY  #LRARAM  ; LOAD LRA TABLE BASE ADDRESS
2425
0893                                 LDB  A,Y      ; GET PHYSICAL ADDR. DATA FROM LRA TABLE
2426
0894                                 LSRB          ; ADJ. REAL ADDR. TO REFLECT EXTENDED
2427
0895                                 LSRB          ; PHYSICAL ADDRESS.
2428
0896                                 LSRB          ; EXTENDED MS 4-BITS ARE RETURNED
2429
0897                                 LSRB          ; IN THE "A" ACCUMULATOR
2430
0898                                 STB  ,S       ; MS 4 BITS IN A ACCUM. STORED ON STACK
2431
0899                                 LDB  A,Y      ; LOAD REAL ADDRESS DATA FROM LRA TABLE
2432
0900                                 COMB          ; COMP TO ADJ FOR PHYSICAL ADDR. IN X REG
2433
0901                                 ASLB          ; ADJ DATA FOR RELOCATION IN X REG
2434
0902                                 ASLB          ;
2435
0903                                 ASLB          ; $FB97
2436
0904                                 ASLB          ;
2437
0905                                 LDA  2,S      ; GET MS BYTE OF LOGICAL ADDR.
2438
0906                                 ANDA #$0F     ; MASK MS NIBBLE OF LOGICAL ADDRESS
2439
0907                                 STA  2,S      ; SAVE IT IN X REG ON STACK
2440
0908                                 ORB  2,S      ; SET MS BYTE IN X REG TO ADJ PHY ADDR.
2441
0909                         *
2442
0910                         * PLUS LS NIBBLE OF LOGICAL ADDRESS
2443
0911                         *
2444
0912                                 STB  2,S      ; SAVE AS LS 16 BITS OF PHY ADDR IN X REG ON STACK
2445
0913                                 PULS A,B,X,Y,PC ; POP REGS. FROM STACK
2446
0914                                 ENDIF DATOPT
2447
0914                                 ENDIF DATOPT
2448
0915                         *
2449
0916                         * DELAY LOOP
2450
0917                         *
2451
0918 F9BC 34 04              DLY     PSHS B        ; SAVE CONTENTS OF "B"
2452
0919 F9BE C6 20                      LDB  #$20     ; GET LOOP DELAY VALUE
2453
0920 F9C0 5A                 SUB1    DECB          ; SUBTRACT ONE FROM VALUE
2454
0921 F9C1 26 FD                      BNE  SUB1     ; LOOP UNTIL ZERO
2455
0922 F9C3 35 84                      PULS B,PC     ; RESTORE CONTENTS OF "B"
2456
0923                         * RTS  ;
2457
0924                         *
2458
0925                         ***** "L" LOAD MIKBUG TAPE *****
2459
0926                         *
2460
0927 F9C5 BD FC 36           LOAD    JSR  ACINIZ
2461
0928 F9C8 86 11                      LDA  #$11     ; LOAD 'DC1' CASS. READ ON CODE
2462
0929 F9CA 17 02 54                   LBSR OUTCH    ; OUTPUT IT TO TERMINAL PORT
2463
0930 F9CD 7F DF D2                   CLR  ECHO     ; TURN OFF ECHO FLAG
2464
0931 F9D0 17 02 26           LOAD1   LBSR ECHON    ; INPUT 8 BIT BYTE WITH NO ECHO
2465
0932 F9D3 81 53              LOAD2   CMPA #'S      ; IS IT AN "S", START CHARACTER ?
2466
0933 F9D5 26 F9                      BNE  LOAD1    ; IF NOT, DISCARD AND GET NEXT CHAR.
2467
0934 F9D7 17 02 1F                   LBSR ECHON
2468
0935 F9DA 81 39                      CMPA #'9      ; IS IT A "9" , END OF FILE CHAR ?
2469
0936 F9DC 27 3D                      BEQ  LOAD21   ; IF SO, EXIT LOAD
2470
0937 F9DE 81 31                      CMPA #'1      ; IS IT A "1" , FILE LOAD CHAR ?
2471
0938 F9E0 26 F1                      BNE  LOAD2    ; IF NOT, LOOK FOR START CHAR.
2472
0939 F9E2 17 01 A8                   LBSR BYTE     ; INPUT BYTE COUNT
2473
0940 F9E5 34 02                      PSHS A        ; PUSH COUNT ON STACK
2474
0941 F9E7 29 26                      BVS  LODERR   ; (V) C-CODE SET, ILLEGAL HEX
2475
0942 F9E9 17 01 91                   LBSR IN1ADR   ; INPUT LOAD ADDRESS
2476
0943 F9EC 29 21                      BVS  LODERR   ; (V) C-CODE SET, ADDR NOT HEX
2477
0944 F9EE 34 10                      PSHS X        ; PUSH ADDR ON STACK
2478
0945 F9F0 E6 E0                      LDB  ,S+      ; LOAD MSB OF ADDR AS CHECKSUM BYTE
2479
0946 F9F2 EB E0                      ADDB ,S+      ; ADD LSB OF ADDR TO CHECKSUM
2480
0947 F9F4 EB E4                      ADDB ,S       ; ADD BYTE COUNT BYTE TO CHECKSUM
2481
0948 F9F6 6A E4                      DEC  ,S       ; $FC37 DECREMENT BYTE COUNT 2 TO BYPASS
2482
0949 F9F8 6A E4                      DEC  ,S       ; ADDRESS BYTES.
2483
0950 F9FA 34 04              LOAD10  PSHS B        ; PUSH CHECKSUM ON STACK
2484
0951 F9FC 17 01 8E                   LBSR BYTE     ; INPUT DATA BYTE (2 HEX CHAR)
2485
0952 F9FF 35 04                      PULS B        ; POP CHECKSUM FROM STACK
2486
0953 FA01 29 0C                      BVS  LODERR   ; (V) SET, DATA BYTE NOT HEX
2487
0954 FA03 34 02                      PSHS A        ; PUSH DATA BYTE ON STACK
2488
0955 FA05 EB E0                      ADDB ,S+      ; ADD DATA TO CHECKSUM, AUTO INC STACK
2489
0956 FA07 6A E4                      DEC  ,S       ; DECREMENT BYTE COUNT 1
2490
0957 FA09 27 05                      BEQ  LOAD16   ; IF BYTE COUNT ZERO, TEST CHECKSUM
2491
0958 FA0B A7 80                      STA  ,X+      ; SAVE DATA BYTE IN MEMORY
2492
0959 FA0D 20 EB                      BRA  LOAD10   ; GET NEXT DATA BYTE
2493
0960 FA0F 5F                 LODERR  CLRB          ; ERROR CONDITION, ZERO CHECKSUM  ;
2494
0961 FA10 35 02              LOAD16  PULS A        ; ADJUST STACK (REMOVE BYTE COUNT)
2495
0962 FA12 C1 FF                      CMPB #$FF     ; CHECKSUM OK?
2496
0963 FA14 27 BA                      BEQ  LOAD1    ; IF SO, LOAD NEXT LINE
2497
0964 FA16 86 3F                      LDA  #'?      ; LOAD (?) ERROR INDICATOR
2498
0965 FA18 17 02 06                   LBSR OUTCH    ; OUTPUT IT TO TERMINAL
2499
0966 FA1B 73 DF D2           LOAD21  COM  ECHO     ; TURN ECHO ON
2500
0967 FA1E 86 13                      LDA  #$13     ; $FC5F LOAD 'DC3' CASS. READ OFF CODE
2501
0968 FA20 16 01 FE                   LBRA OUTCH    ; OUTPUT IT
2502
0969                         *
2503
0970                         ***** "P" PUNCH MIKBUG TAPE *****
2504
0971                         *
2505
0972 FA23 6F E2              PUNCH   CLR  ,-S      ; CLEAR RESERVED BYTE ON STACK
2506
0973 FA25 17 01 4A                   LBSR IN2ADR   ; GET BEGIN AND END ADDRESS
2507
0974 FA28 34 30                      PSHS X,Y      ; SAVE ADDRESSES ON STACK
2508
0975 FA2A 29 4D                      BVS  PUNEXT   ; (V) C-CODE SET, EXIT PUNCH
2509
0976 FA2C AC 62                      CMPX 2,S      ; COMPARE BEGIN TO END ADDR
2510
0977 FA2E 25 49                      BCS  PUNEXT   ; IF BEGIN GREATER THAN END, EXIT PUNCH
2511
0978 FA30 30 01                      LEAX 1,X      ; INCREMENT END ADDRESS
2512
0979 FA32 AF E4                      STX  ,S       ; STORE END ADDR ON STACK
2513
0980 FA34 BD FC 36                   JSR  ACINIZ
2514
0981 FA37 86 12                      LDA  #$12     ; LOAD 'DC2' PUNCH ON CODE
2515
0982 FA39 17 01 E5                   LBSR OUTCH    ; OUTPUT IT TO TERMINAL
2516
0983 FA3C EC E4              PUNCH2  LDD  ,S       ; LOAD END ADDR IN D-ACC
2517
0984 FA3E A3 62                      SUBD 2,S      ; SUBTRACT BEGIN FROM END
2518
0985 FA40 27 06                      BEQ  PUNCH3   ; SAME, PUNCH 32 BYTES DEFAULT
2519
0986 FA42 10 83 00 20                CMPD #$20     ; LESS THAN 32 BYTES?
2520
0987 FA46 23 02                      BLS  PUNCH4   ; PUNCH THAT MANY BYTES
2521
0988 FA48 C6 20              PUNCH3  LDB  #$20     ; LOAD BYTE COUNT OF 32.
2522
0989 FA4A E7 64              PUNCH4  STB  4,S      ; STORE ON STACK AS BYTE COUNT
2523
0990 FA4C 8E FC F6                   LDX  #MSG20   ; POINT TO MSG "S1"
2524
0991 FA4F 17 00 2F                   LBSR PSTRNG   ; PRINT MSG
2525
0992 FA52 CB 03                      ADDB #3       ; ADD 3 BYTES TO BYTE COUNT
2526
0993 FA54 1F 98                      TFR  B,A      ; GET BYTE COUNT IN A-ACC TO PUNCH
2527
0994 FA56 17 01 75                   LBSR OUT2H    ; OUTPUT BYTE COUNT
2528
0995 FA59 AE 62                      LDX  2,S      ; LOAD BEGIN ADDRESS
2529
0996 FA5B 17 01 68                   LBSR OUT4H    ; PUNCH ADDRESS
2530
0997 FA5E EB 62                      ADDB 2,S      ; ADD ADDR MSB TO CHECKSUM
2531
0998 FA60 EB 63                      ADDB 3,S      ; ADD ADDR LSB TO CHECKSUM
2532
0999 FA62 EB 84              PUNCHL  ADDB ,X       ; ADD DATA BYTE TO CHECKSUM
2533
1000 FA64 A6 80                      LDA  ,X+      ; LOAD DATA BYTE TO PUNCH
2534
1001 FA66 17 01 65                   LBSR OUT2H    ; OUTPUT DATA BYTE
2535
1002 FA69 6A 64                      DEC  4,S      ; DECREMENT BYTE COUNT
2536
1003 FA6B 26 F5                      BNE  PUNCHL   ; NOT DONE, PUNCH NEXT BYTE
2537
1004 FA6D 53                         COMB  1's     ; COMPLIMENT CHECKSUM BYTE
2538
1005 FA6E 1F 98                      TFR  B,A      ; GET IT IN A-ACC TO PUNCH
2539
1006 FA70 17 01 5B                   LBSR OUT2H    ; OUTPUT CHECKSUM BYTE
2540
1007 FA73 AF 62                      STX  2,S      ; SAVE X-REG IN STACK AS NEW PUNCH ADDR
2541
1008 FA75 AC E4                      CMPX ,S       ; COMPARE IT TO END ADDR
2542
1009 FA77 26 C3                      BNE  PUNCH2   ; $FCB5 PUNCH NOT DONE, CONT.
2543
1010 FA79 86 14              PUNEXT  LDA  #$14     ; LOAD 'DC4' PUNCH OFF CODE
2544
1011 FA7B 17 01 A3                   LBSR OUTCH    ; OUTPUT IT
2545
1012 FA7E 32 65                      LEAS 5,S      ; READJUST STACK POINTER
2546
1013 FA80 39                         RTS  ;
2547
1014                         *
2548
1015                         * PRINT STRING PRECEEDED BY A CR & LF.
2549
1016                         *
2550
1017 FA81 8D 02              PSTRNG  BSR  PCRLF    ; PRINT CR/LF
2551
1018 FA83 20 71                      BRA  PDATA    ; PRINT STRING POINTED TO BY IX
2552
1019                         *
2553
1020                         * PCRLF
2554
1021                         *
2555
1022 FA85 34 10              PCRLF   PSHS X        ; SAVE IX
2556
1023 FA87 8E FC A7                   LDX  #MSG2+1  ; POINT TO MSG CR/LF + 3 NULS
2557
1024 FA8A 17 00 69                   LBSR PDATA    ; PRINT MSG
2558
1025 FA8D 35 90                      PULS X,PC     ; RESTORE IX & RETURN
2559
1026                         *
2560
1027                         * LONG BRANCHES TO COMMON ROUTINES
2561
1028                         *
2562
1029 FA8F 16 01 8D           JOUT1S  LBRA OUT1S
2563
1030 FA92 16 00 F8           JBYTE   LBRA BYTE
2564
1031 FA95 16 00 E5           JIN1ADR LBRA IN1ADR
2565
1032                         *
2566
1033                         * ALTER "PC" PROGRAM COUNTER
2567
1034                         *
2568
1035 FA98 17 00 91           ALTRPC  LBSR  PRTPC   ; $FCF5 PRINT MSG " PC = "
2569
1036 FA9B 8D F2              ALTPC1  BSR  JOUT1S   ; OUTPUT SPACE
2570
1037 FA9D 8D F6                      BSR  JIN1ADR  ; GET NEW CONTENTS FOR "PC"
2571
1038 FA9F 29 02                      BVS  ALTPCD   ; EXIT IF INVALID HEX
2572
1039 FAA1 AF 4A                      STX  10,U     ; POKE IN NEW CONTENTS
2573
1040 FAA3 39                 ALTPCD  RTS           ;
2574
1041                         *
2575
1042                         * ALTER "U" USER STACK POINTER
2576
1043                         *
2577
1044 FAA4 8D 61              ALTRU   BSR  PRTUS    ; $FCCA PRINT MSG " US = "
2578
1045 FAA6 8D E7                      BSR  JOUT1S   ; OUTPUT SPACE
2579
1046 FAA8 8D EB                      BSR  JIN1ADR  ; GET NEW CONTENTS FOR "US"
2580
1047 FAAA 29 02                      BVS  ALTUD    ; EXIT IF INVALID HEX
2581
1048 FAAC AF 48                      STX  8,U      ; POKE IN NEW CONTENTS
2582
1049 FAAE 39                 ALTUD   RTS           ;
2583
1050                         *
2584
1051                         * ALTER "Y" INDEX REGISTER
2585
1052                         *
2586
1053 FAAF 8D 72              ALTRY   BSR  PRTIY    ; PRINT MSG " IY = "
2587
1054 FAB1 8D DC                      BSR  JOUT1S   ; OUTPUT SPACE
2588
1055 FAB3 8D E0                      BSR  JIN1ADR  ; GET NEW CONTENTS FOR "IY"
2589
1056 FAB5 29 02                      BVS  ALTYD    ; EXIT IF INVALID HEX
2590
1057 FAB7 AF 46                      STX  6,U      ; $F8F0 POKE IN NEW CONTENTS
2591
1058 FAB9 39                 ALTYD   RTS           ;
2592
1059                         *
2593
1060                         * ALTER "X" INDEX REGISTER
2594
1061                         *
2595
1062 FABA 8D 5E              ALTRX   BSR  PRTIX    ; $FCE0 PRINT MSG " IX = "
2596
1063 FABC 8D D1                      BSR  JOUT1S   ; OUTPUT SPACE
2597
1064 FABE 8D D5                      BSR  JIN1ADR
2598
1065 FAC0 29 02                      BVS  ALTXD
2599
1066 FAC2 AF 44                      STX  4,U
2600
1067 FAC4 39                 ALTXD   RTS ;
2601
1068                         *
2602
1069                         * ALTER "DP" DIRECT PAGE REGISTER
2603
1070                         *
2604
1071 FAC5 8D 49              ALTRDP  BSR  PRTDP    ; $FCD5 PRINT MSG " DP = "
2605
1072 FAC7 8D C6                      BSR  JOUT1S   ; OUTPUT SPACE
2606
1073 FAC9 8D C7                      BSR  JBYTE    ; INPUT BYTE (2 HEX CHAR)
2607
1074 FACB 29 02                      BVS  ALTDPD
2608
1075 FACD A7 43                      STA  3,U
2609
1076 FACF 39                 ALTDPD  RTS ;
2610
1077                         *
2611
1078                         * ALTER "B" ACCUMULATOR
2612
1079                         *
2613
1080 FAD0 8D 6C              ALTRB   BSR  PRTB     ; $FD09 PRINT MSG " B = "
2614
1081 FAD2 8D BB                      BSR  JOUT1S   ; OUTPUT SPACE
2615
1082 FAD4 8D BC                      BSR  JBYTE    ; INPUT BYTE (2 HEX CHAR)
2616
1083 FAD6 29 02                      BVS  ALTBD
2617
1084 FAD8 A7 42                      STA  2,U
2618
1085 FADA 39                 ALTBD   RTS           ; $F91C
2619
1086                         *
2620
1087                         * ALTER "A" ACCUMULATOR
2621
1088                         *
2622
1089 FADB 8D 58              ALTRA   BSR  PRTA     ; $FCFF RINT MSG " A = "
2623
1090 FADD 8D B0                      BSR  JOUT1S   ; OUTPUT SPACE
2624
1091 FADF 8D B1                      BSR  JBYTE    ; INPUT BYTE (2 HEX CHAR)
2625
1092 FAE1 29 02                      BVS  ALTAD
2626
1093 FAE3 A7 41                      STA  1,U
2627
1094 FAE5 39                 ALTAD   RTS ;
2628
1095                         *
2629
1096                         * ALTER "CC" REGISTER
2630
1097                         *
2631
1098 FAE6 8D 5F              ALTRCC  BSR  PRTCC    ; $FD13 PRINT MSG " CC: "
2632
1099 FAE8 8D A5                      BSR  JOUT1S   ; OUTPUT SPACE
2633
1100 FAEA 8D A6                      BSR  JBYTE    ; INPUT BYTE (2 HEX CHAR)
2634
1101 FAEC 29 04                      BVS  ALTCCD
2635
1102 FAEE 8A 80                      ORA  #$80     ; SETS "E" FLAG IN PRINT LIST
2636
1103 FAF0 A7 C4                      STA  ,U
2637
1104 FAF2 39                 ALTCCD  RTS ;
2638
1105                         *
2639
1106                         * PDATA
2640
1107                         *
2641
1108 FAF3 17 01 2B           PRINT   LBSR OUTCH
2642
1109 FAF6 A6 80              PDATA   LDA  ,X+      ; GET 1st CHAR. TO PRINT
2643
1110 FAF8 81 04                      CMPA #4       ; IS IT EOT?
2644
1111 FAFA 26 F7                      BNE  PRINT    ; IF NOT EOT PRINT IT
2645
1112 FAFC 39                         RTS  ;
2646
1113                         *
2647
1114                         * PRINT REGISTERS
2648
1115                         *
2649
1116 FAFD 8E FC B9           PRTSP   LDX  #MSG10   ; POINT TO MSG "SP="
2650
1117 FB00 8D F4                      BSR  PDATA    ; PRINT MSG
2651
1118 FB02 1F 31                      TFR  U,X
2652
1119 FB04 16 00 BF           JOUT4H  LBRA OUT4H
2653
1120                         *
2654
1121 FB07 8E FC C5           PRTUS   LDX  #MSG12   ; POINT TO MSG "US="
2655
1122 FB0A 8D EA                      BSR  PDATA    ; PRINT MSG
2656
1123 FB0C AE 48                      LDX  8,U
2657
1124 FB0E 20 F4                      BRA  JOUT4H
2658
1125                         *
2659
1126 FB10 8E FC D7           PRTDP   LDX   #MSG15  ; POINT TO MSG "DP="
2660
1127 FB13 8D E1                      BSR  PDATA    ; PRINT MSG
2661
1128 FB15 A6 43                      LDA  3,U
2662
1129 FB17 16 00 B4           JOUT2H  LBRA OUT2H    ; OUTPUT HEX BYTE AS ASCII
2663
1130                         *
2664
1131 FB1A 8E FC D1           PRTIX   LDX  #MSG14   ; POINT TO MSG "IX="
2665
1132 FB1D 8D D7                      BSR  PDATA    ; PRINT MSG
2666
1133 FB1F AE 44                      LDX  4,U      ; $FCE6
2667
1134 FB21 20 E1                      BRA  JOUT4H
2668
1135                         *
2669
1136 FB23 8E FC CB           PRTIY   LDX  #MSG13   ; POINT TO MSG "IY="
2670
1137 FB26 8D CE                      BSR  PDATA    ; PRINT MSG
2671
1138 FB28 AE 46                      LDX  6,U
2672
1139 FB2A 20 D8                      BRA  JOUT4H
2673
1140                         *
2674
1141 FB2C 8E FC BF           PRTPC   LDX  #MSG11   ; POINT TO MSG "PC="
2675
1142 FB2F 8D C5                      BSR  PDATA    ; PRINT MSG
2676
1143 FB31 AE 4A                      LDX  10,U
2677
1144 FB33 20 CF                      BRA  JOUT4H
2678
1145                         *
2679
1146 FB35 8E FC DD           PRTA    LDX  #MSG16   ; POINT TO MSG "A="
2680
1147 FB38 8D BC                      BSR  PDATA    ; PRINT MSG
2681
1148 FB3A A6 41                      LDA  1,U
2682
1149 FB3C 20 D9                      BRA  JOUT2H   ; OUTPUT HEX BYTE AS ASCII
2683
1150                         *
2684
1151 FB3E 8E FC E2           PRTB    LDX  #MSG17   ; POINT TO MSG "B="
2685
1152 FB41 8D B3                      BSR  PDATA    ; PRINT MSG
2686
1153 FB43 A6 42                      LDA  2,U
2687
1154 FB45 20 D0                      BRA  JOUT2H   ; OUTPUT HEX BYTE AS ASCII
2688
1155                         *
2689
1156 FB47 8E FC E7           PRTCC   LDX  #MSG18   ; POINT TO MSG "CC:"
2690
1157 FB4A 8D AA                      BSR  PDATA    ; PRINT MSG
2691
1158 FB4C A6 C4                      LDA  ,U
2692
1159 FB4E 8E FC EE                   LDX  #MSG19   ; POINT TO MSG "EFHINZVC"
2693
1160 FB51 16 00 90                   LBRA BIASCI   ; OUTPUT IN BINARY/ASCII FORMAT
2694
1161                         *
2695
1162                         * "R" DISPLAY REGISTERS
2696
1163                         *
2697
1164 FB54 8E FC B5           REGSTR  LDX  #MSG5    ; POINT TO MSG " - "
2698
1165 FB57 17 FF 27                   LBSR PSTRNG   ; PRINT MSG
2699
1166 FB5A 8D A1                      BSR  PRTSP    ; $FCBF
2700
1167 FB5C 8D A9                      BSR  PRTUS    ; $FCCA
2701
1168 FB5E 8D B0                      BSR  PRTDP    ; $FCD5
2702
1169 FB60 8D B8                      BSR  PRTIX    ; $FCE0
2703
1170 FB62 8D BF                      BSR  PRTIY    ; $FCEB
2704
1171 FB64 8E FC B5                   LDX  #MSG5    ; POINT TO MSG " - "
2705
1172 FB67 17 FF 17                   LBSR PSTRNG   ; PRINT MSG
2706
1173 FB6A 8D C0                      BSR  PRTPC    ; $FCF5
2707
1174 FB6C 8D C7                      BSR  PRTA     ; $FCFF
2708
1175 FB6E 8D CE                      BSR  PRTB     ; $FD09
2709
1176 FB70 20 D5                      BRA  PRTCC    ; $FD13
2710
1177                         *
2711
1178                         * THE FOLLOWING ROUTINE LOOPS WAITING FOR THE
2712
1179                         * OPERATOR TO INPUT TWO VALID HEX ADDRESSES.
2713
1180                         * THE FIRST ADDRESS INPUT IS RETURNED IN "IY".
2714
1181                         * THE SECOND IS RETURNED IN "IX". THE "V" BIT
2715
1182                         * IN THE C-CODE REG. IS SET IF AN INVALID HEX
2716
1183                         * ADDRESS IS INPUT.
2717
1184                         *
2718
1185 FB72 8D 09              IN2ADR  BSR  IN1ADR   ; GET FIRST ADDRESS
2719
1186 FB74 29 4D                      BVS  NOTHEX   ; EXIT IF NOT VALID HEX
2720
1187 FB76 1F 12                      TFR  X,Y      ; SAVE FIRST ADDR. IN "IY"
2721
1188 FB78 86 2D                      LDA  #'-
2722
1189 FB7A 17 00 A4                   LBSR OUTCH    ; PRINT " - "
2723
1190                         *
2724
1191                         * THE FOLLOWING ROUTINE LOOPS WAITING FOR THE
2725
1192                         * OPERATOR TO INPUT ONE VALID HEX ADDRESS. THE
2726
1193                         * ADDRESS IS RETURNED IN THE "X" REGISTER.
2727
1194                         *
2728
1195 FB7D 8D 0E              IN1ADR  BSR  BYTE     ; INPUT BYTE (2 HEX CHAR)
2729
1196 FB7F 29 42                      BVS  NOTHEX   ; EXIT IF NOT VALID HEX
2730
1197 FB81 1F 01                      TFR  D,X
2731
1198 FB83 8D 08                      BSR  BYTE     ; INPUT BYTE (2 HEX CHAR)
2732
1199 FB85 29 3C                      BVS  NOTHEX
2733
1200 FB87 34 10                      PSHS X
2734
1201 FB89 A7 61                      STA  1,S
2735
1202 FB8B 35 90                      PULS X,PC
2736
1203                         *
2737
1204                         ***** INPUT BYTE (2 HEX CHAR.) *****
2738
1205                         *
2739
1206 FB8D 8D 11              BYTE    BSR  INHEX    ; GET HEX LEFT
2740
1207 FB8F 29 32                      BVS  NOTHEX   ; EXIT IF NOT VALID HEX
2741
1208 FB91 48                         ASLA          ;
2742
1209 FB92 48                         ASLA          ;
2743
1210 FB93 48                         ASLA          ; SHIFT INTO LEFT NIBBLE
2744
1211 FB94 48                         ASLA          ;
2745
1212 FB95 1F 89                      TFR  A,B      ; PUT HEXL IN "B"
2746
1213 FB97 8D 07                      BSR  INHEX    ; GET HEX RIGHT
2747
1214 FB99 29 28                      BVS  NOTHEX   ; EXIT IF NOT VALID HEX
2748
1215 FB9B 34 04                      PSHS B        ; PUSH HEXL ON STACK
2749
1216 FB9D AB E0                      ADDA ,S+      ; ADD HEXL TO HEXR AND ADJ. STK
2750
1217 FB9F 39                         RTS           ; RETURN WITH HEX L&R IN "A"
2751
1218                         *
2752
1219                         *
2753
1220 FBA0 8D 57              INHEX   BSR  ECHON    ; INPUT ASCII CHAR.
2754
1221 FBA2 81 30                      CMPA #'0      ; IS IT > OR = "0" ?
2755
1222 FBA4 25 1D                      BCS  NOTHEX   ; IF LESS IT AIN'T HEX
2756
1223 FBA6 81 39                      CMPA #'9      ; IS IT < OR = "9" ?
2757
1224 FBA8 22 03                      BHI  INHEXA   ; IF > MAYBE IT'S ALPHA
2758
1225 FBAA 80 30                      SUBA #$30     ; ASCII ADJ. NUMERIC
2759
1226 FBAC 39                         RTS           ;
2760
1227                         *
2761
1228                         *
2762
1229 FBAD 81 41              INHEXA  CMPA #'A      ; IS IT > OR = "A"
2763
1230 FBAF 25 12                      BCS  NOTHEX   ; IF LESS IT AIN'T HEX
2764
1231 FBB1 81 46                      CMPA #'F      ; IS IT < OR = "F" ?
2765
1232 FBB3 22 03                      BHI  INHEXL   ; IF > IT AIN'T HEX
2766
1233 FBB5 80 37                      SUBA #'A-10   ; ($37) ASCII ADJ. ALPHA
2767
1234 FBB7 39                         RTS           ;
2768
1235                         *
2769
1236 FBB8 81 61              INHEXL  CMPA #'a      ; IS IT > OR = "a"
2770
1237 FBBA 25 07                      BCS  NOTHEX   ; IF LESS IT AIN'T HEX
2771
1238 FBBC 81 66                      CMPA #'f      ; IS IT < "f"
2772
1239 FBBE 22 03                      BHI  NOTHEX   ; IF > IT AIN'T HEX
2773
1240 FBC0 80 57                      SUBA #'a-10   ; ($57) ADJUST TO LOWER CASE
2774
1241 FBC2 39                         RTS           ;
2775
1242                         *
2776
1243                         *
2777
1244 FBC3 1A 02              NOTHEX  ORCC #2       ; SET (V) FLAG IN C-CODES REGISTER
2778
1245 FBC5 39                         RTS           ;
2779
1246                         *
2780
1247                         *
2781
1248 FBC6 34 10              OUT4H   PSHS X        ; PUSH X-REG. ON THE STACK
2782
1249 FBC8 35 02                      PULS A        ; POP MS BYTE OF X-REG INTO A-ACC.
2783
1250 FBCA 8D 02                      BSR  OUTHL    ; OUTPUT HEX LEFT
2784
1251 FBCC 35 02                      PULS A        ; POP LS BYTE OF X-REG INTO A-ACC.
2785
1252 FBCE                    OUTHL   EQU *
2786
1253 FBCE 34 02              OUT2H   PSHS A        ; SAVE IT BACK ON STACK
2787
1254 FBD0 44                         LSRA          ; CONVERT UPPER HEX NIBBLE TO ASCII
2788
1255 FBD1 44                         LSRA          ;
2789
1256 FBD2 44                         LSRA          ;
2790
1257 FBD3 44                         LSRA          ;
2791
1258 FBD4 8D 04                      BSR  XASCII   ; PRINT HEX NIBBLE AS ASCII
2792
1259 FBD6 35 02              OUTHR   PULS A        ; CONVERT LOWER HEX NIBBLE TO ASCII
2793
1260 FBD8 84 0F                      ANDA #$0F     ; STRIP LEFT NIBBLE
2794
1261 FBDA 8B 30              XASCII  ADDA #$30     ; ASCII ADJ
2795
1262 FBDC 81 39                      CMPA #$39     ; IS IT < OR = "9" ?
2796
1263 FBDE 2F 02                      BLE  OUTC     ; IF LESS, OUTPUT IT
2797
1264 FBE0 8B 07                      ADDA #7       ; IF > MAKE ASCII LETTER
2798
1265 FBE2 20 3D              OUTC    BRA  OUTCH    ; OUTPUT CHAR
2799
1266                         *
2800
1267                         * BINARY / ASCII --- THIS ROUTINE
2801
1268                         * OUTPUTS A BYTE IN ENHANCED
2802
1269                         * BINARY FORMAT. THE ENHANCEMENT
2803
1270                         * IS DONE BY SUBSTITUTING ASCII
2804
1271                         * LETTERS FOR THE ONES IN THE BYTE.
2805
1272                         * THE ASCII ENHANCEMENT LETTERS
2806
1273                         * ARE OBTAINED FROM THE STRING
2807
1274                         * POINTED TO BY THE INDEX REG. "X".
2808
1275                         *
2809
1276 FBE4 34 02              BIASCI  PSHS A        ; SAVE "A" ON STACK
2810
1277 FBE6 C6 08                      LDB  #8       ; PRESET LOOP# TO BITS PER BYTE
2811
1278 FBE8 A6 80              OUTBA   LDA  ,X+      ; GET LETTER FROM STRING
2812
1279 FBEA 68 E4                      ASL  ,S       ; TEST BYTE FOR "1" IN B7
2813
1280 FBEC 25 02                      BCS  PRTBA    ; IF ONE PRINT LETTER
2814
1281 FBEE 86 2D                      LDA  #'-      ; IF ZERO PRINT "-"
2815
1282 FBF0 8D 2F              PRTBA   BSR  OUTCH    ; PRINT IT
2816
1283 FBF2 8D 2B                      BSR  OUT1S    ; PRINT SPACE
2817
1284 FBF4 5A                         DECB          ; SUB 1 FROM #BITS YET TO PRINT
2818
1285 FBF5 26 F1                      BNE  OUTBA
2819
1286 FBF7 35 82                      PULS A,PC
2820
1287                         *
2821
1288                                 IFD EXTOPT
2822
1289                         *
2823
1290                         * EXTENDED USER COMMANDS
2824
1291                         *
2825
1292                         USRCMD  JMP [MONEXT+EXTCMD]
2826
1293                                 ENDIF EXTOPT
2827
1293                                 ENDIF EXTOPT
2828
1294                         *
2829
1295                         *
2830
1296 FBF9 7D DF D2           ECHON   TST  ECHO     ; IS ECHO REQUIRED ?
2831
1297 FBFC 27 06                      BEQ  INCH     ; ECHO NOT REQ. IF CLEAR
2832
1298                         *
2833
1299                         * INCHE
2834
1300                         *
2835
1301                         * GETS CHARACTER FROM TERMINAL AND
2836
1302                         * ECHOS SAME. THE CHARACTER IS RETURNED
2837
1303                         * IN THE "A" ACCUMULATOR WITH THE PARITY
2838
1304                         * BIT MASKED OFF. ALL OTHER REGISTERS
2839
1305                         * ARE PRESERVED.
2840
1306                         *
2841
1307 FBFE 8D 04              INCHE   BSR  INCH     ; GET CHAR FROM TERMINAL
2842
1308 FC00 84 7F                      ANDA #$7F     ; STRIP PARITY FROM CHAR.
2843
1309 FC02 20 1D                      BRA  OUTCH    ; ECHO CHAR TO TERMINAL
2844
1310                         *
2845
1311                         * INCH
2846
1312                         *
2847
1313                         * GET CHARACTER FROM TERMINAL. RETURN
2848
1314                         * CHARACTER IN "A" ACCUMULATOR AND PRESERVE
2849
1315                         * ALL OTHER REGISTERS. THE INPUT CHARACTER
2850
1316                         * IS 8 BITS AND IS NOT ECHOED.
2851
1317                         *
2852
1318                         *
2853
1319 FC04 34 10              INCH    PSHS X        ; SAVE IX
2854
1320                                 IFD  HFCOPT
2855
1321                                 LDA  #$11     ; SET RTS* LOW, REQUEST FAR END TO TX
2856
1322                                 STA  [CPORT]
2857
1323                                 ENDIF HFCOPT
2858
1323                                 ENDIF HFCOPT
2859
1324 FC06 BE DF D0           GETSTA  LDX  CPORT    ; POINT TO TERMINAL PORT
2860
1325 FC09 A6 84                      LDA  ,X       ; FETCH PORT STATUS
2861
1326 FC0B 85 01                      BITA #1       ; TEST READY BIT, RDRF ?
2862
1327                                 IFD  PS2OPT
2863
1328                                 BNE  GETST1
2864
1329                                 LDX  #PS2KBD
2865
1330                                 LDA  ,X
2866
1331                                 BITA #1
2867
1332                                 ENDIF PS2OPT
2868
1332                                 ENDIF PS2OPT
2869
1333 FC0D 27 F7                      BEQ  GETSTA   ; IF NOT RDY, THEN TRY AGAIN
2870
1334 FC0F                    GETST1  EQU  *
2871
1335                                 IFD  HFCOPT
2872
1336                                 LDA  #$51     ; SET RTS* HIGH, STOP FAR END FROM TXING, UNTIL NEXT INPUT
2873
1337                                 STA  [CPORT]
2874
1338                                 ENDIF HFCOPT
2875
1338                                 ENDIF HFCOPT
2876
1339 FC0F A6 01                      LDA  1,X      ; FETCH CHAR
2877
1340 FC11 35 90                      PULS X,PC     ; RESTORE IX
2878
1341                         *
2879
1342                         * INCHEK
2880
1343                         *
2881
1344                         * CHECK FOR A CHARACTER AVAILABLE FROM
2882
1345                         * THE TERMINAL. THE SERIAL PORT IS CHECKED
2883
1346                         * FOR READ READY. ALL REGISTERS ARE
2884
1347                         * PRESERVED, AND THE "Z" BIT WILL BE
2885
1348                         * CLEAR IF A CHARACTER CAN BE READ.
2886
1349                         *
2887
1350                         *
2888
1351 FC13 34 02              INCHEK  PSHS A        ; SAVE A ACCUM
2889
1352                                 IFD  HFCOPT
2890
1353                                 LDA  #$11     ; SET RTS* LOW, REQUEST FAR END TO TX
2891
1354                                 STA  [CPORT]
2892
1355                                 ENDIF HFCOPT
2893
1355                                 ENDIF HFCOPT
2894
1356 FC15 A6 9F DF D0                LDA  [CPORT]  ; FETCH PORT STATUS
2895
1357 FC19 85 01                      BITA #1       ; TEST READY BIT, RDRF ?
2896
1358                                 IFD  PS2OPT
2897
1359                                 BNE  INCHEK1
2898
1360                                 LDA  PS2KBD
2899
1361                                 BITA #1       ; TEST READY BIT< RDRF ?
2900
1362                                 ENDIF PS2OPT
2901
1362                                 ENDIF PS2OPT
2902
1363 FC1B 35 82              INCHEK1 PULS A,PC     ; RESTORE A ACCUM.
2903
1364                         *
2904
1365 FC1D 8D 00              OUT2S   BSR  OUT1S    ; OUTPUT 2 SPACES
2905
1366 FC1F 86 20              OUT1S   LDA  #$20     ; OUTPUT 1 SPACE
2906
1367                         *
2907
1368                         *
2908
1369                         * OUTCH
2909
1370                         *
2910
1371                         * OUTPUT CHARACTER TO TERMINAL.
2911
1372                         * THE CHAR. TO BE OUTPUT IS
2912
1373                         * PASSED IN THE A REGISTER.
2913
1374                         * ALL REGISTERS ARE PRESERVED.
2914
1375                         *
2915
1376                         OUTCH   IFD   VDUOPT
2916
1377                                 BSR   VOUTCH
2917
1378                                 ENDIF VDUOPT
2918
1378                                 ENDIF VDUOPT
2919
1379                                 IFD   DG640OPT
2920
1380                                 BSR   VOUTCH
2921
1381                                 ENDIF DG640OPT
2922
1381                                 ENDIF DG640OPT
2923
1382 FC21 34 12              AOUTCH  PSHS A,X      ; SAVE A ACCUM AND IX
2924
1383 FC23 BE DF D0                   LDX  CPORT    ; GET ADDR. OF TERMINAL
2925
1384 FC26 A6 84              FETSTA  LDA  ,X       ; FETCH PORT STATUS
2926
1385 FC28 85 02                      BITA #2       ; TEST TDRE, OK TO XMIT ?
2927
1386 FC2A 27 FA                      BEQ  FETSTA   ; IF NOT LOOP UNTIL RDY
2928
1387 FC2C 85 08                      BITA #8       ; CLEAR TO SEND ?
2929
1388 FC2E 26 F6                      BNE  FETSTA   ; NO, LOOP UNTIL CLEAR
2930
1389 FC30 35 02                      PULS A        ; GET CHAR. FOR XMIT
2931
1390 FC32 A7 01                      STA  1,X      ; XMIT CHAR.
2932
1391 FC34 35 90                      PULS X,PC     ; RESTORE IX
2933
1392                         *
2934
1393                         * IO INITIALIZATION
2935
1394                         *
2936
1395 FC36                    IOINIZ  EQU  *
2937
1396                                 IFD  VDUOPT
2938
1397                                 BSR  VINIZ
2939
1398                                 ENDIF VDUOPT
2940
1398                                 ENDIF VDUOPT
2941
1399                                 IFD  DG640OPT
2942
1400                                 BSR  VINIZ
2943
1401                                 ENDIF DG640OPT
2944
1401                                 ENDIF DG640OPT
2945
1402 FC36 BE DF D0           ACINIZ  LDX  CPORT    ; POINT TO CONTROL PORT ADDRESS
2946
1403 FC39 86 03                      LDA  #3       ; RESET ACIA PORT CODE
2947
1404 FC3B A7 84                      STA  ,X       ; STORE IN CONTROL REGISTER
2948
1405 FC3D 86 51                      LDA  #$51     ; SET 8 DATA, 2 STOP AN 0 PARITY RTS* HIGH
2949
1406 FC3F A7 84                      STA  ,X       ; STORE IN CONTROL REGISTER
2950
1407 FC41 6D 01                      TST  1,X      ; ANYTHING IN DATA REGISTER?
2951
1408 FC43 86 FF                      LDA  #$FF     ; TURN ON ECHO FLAG
2952
1409 FC45 B7 DF D2                   STA  ECHO
2953
1410 FC48 39                         RTS
2954
1411                         *
2955
1412                                 IFD VDUOPT
2956
1413                         *
2957
1414                         ***************************************************
2958
1415                         *      VDU8 ADM3A REGISTER-MAPPED EMULATOR        *
2959
1416                         *                                                 *
2960
1417                         *      80 x 25 Characters
2961
1418                         *
2962
1419                         ***************************************************
2963
1420                         *
2964
1421                         ***************************************************
2965
1422                         *               INITIALIZE EMULATOR               *
2966
1423                         ***************************************************
2967
1424                         *
2968
1425                         VINIZ   LDX  #VDU
2969
1426                                 LDD  #0
2970
1427                                 STD  COLADX   ; AND ROWADX
2971
1428                                 STA  VDUCOL,X
2972
1429                                 STB  VDUROW,X
2973
1430                                 STB  VDUOFF,X
2974
1431                                 STD  NEWROW   ; AND ESCFLG
2975
1432                                 LDB  #$02
2976
1433                                 STB  VDUATT,X
2977
1434                                 CLR  ESCFLG
2978
1435                                 LDA  #$1B     ; SEND ESCAPE
2979
1436                                 BSR  VOUTCH
2980
1437                                 LDA  #'Y      ; CLEAR TO END OF SCREEN
2981
1438                         *
2982
1439                         ** VIDEO OUTPUT ROUTINE
2983
1440                         *
2984
1441                         VOUTCH  PSHS A,B,X    ; SAVE REGISTERS
2985
1442                                 LDX  #VDU     ; POINT TO VDU REGISTERS
2986
1443                         *
2987
1444                         ** CHECK FOR ESCAPE SEQUENCE
2988
1445                         *
2989
1446                                 TST  ESCFLG   ; ESCAPE ACTIVE?
2990
1447                                 BEQ  SOROU1   ; BRANCH IF NOT
2991
1448                                 BSR  ESCAPE   ; ELSE DO ESCAPE
2992
1449                                 BRA  RETURN   ; AND RETURN
2993
1450                         *
2994
1451                         ** CHECK FOR CONTROL CHARACTERS
2995
1452                         *
2996
1453                         SOROU1  CMPA #$20     ; CONTROL CODES?
2997
1454                                 BHS  SOROU2
2998
1455                                 BSR  CONTRL   ; BRANCH IF SO
2999
1456                                 BRA  RETURN
3000
1457                         *
3001
1458                         ** OUTPUT TEXT CHARACTER
3002
1459                         *
3003
1460                         SOROU2  STA  VDUCHR,X ; DISPLAY CHARACTER
3004
1461                                 LBSR NEWCOL   ; UPDATE COLUMN
3005
1462                         *
3006
1463                         ** DISPLAY CURSOR AND RETURN
3007
1464                         *
3008
1465                         RETURN  PULS A,B,X,PC ; RESTORE REGISTERS AND RETURN
3009
1466                         *
3010
1467                         ***************************************************
3011
1468                         *              CONTROL CODE HANDLERS              *
3012
1469                         ***************************************************
3013
1470                         *
3014
1471                         CONTRL  CMPA #$08     ; CTRL H - BACKSPACE ?
3015
1472                                 BEQ  BACKSP
3016
1473                                 CMPA #$1B     ; ESCAPE SEQUENCE?
3017
1474                                 BEQ  SETESC
3018
1475                                 CMPA #$1A     ; CTRL Z - Clear Screen
3019
1476                                 LBEQ CLRSCR
3020
1477                                 CMPA #$16     ; CTRL ^ - Home
3021
1478                                 BEQ  HOME
3022
1479                                 CMPA #$0D     ; CTRL M - RETURN?
3023
1480                                 LBEQ CRETN
3024
1481                                 CMPA #$0C     ; CTRL L - CHAR RIGHT
3025
1482                                 BEQ  CHRIGHT
3026
1483                                 CMPA #$0B     ; CTRL K - MOVE UP ONE LINE
3027
1484                                 BEQ  LINEUP
3028
1485                                 CMPA #$0A     ; CTRL J - LINE FEED
3029
1486                                 BNE  RETESC   ; NONE OF THESE, RETURN
3030
1487                         *
3031
1488                         ***************************************** LINE FEED
3032
1489                         *
3033
1490                         LINEFD  LDD  COLADX   ; GET CURRENT COLUMN AND ROW
3034
1491                                 INCB          ; BUMP ROW
3035
1492                                 CMPB #NUMLIN  ; SCROLL TIME?
3036
1493                                 BNE  NEWCUR   ; POSITION CURSOR IF NOT
3037
1494                                 LBRA SCROLL   ; ELSE SCROLL IT
3038
1495                         *
3039
1496                         ***************************************** LINE FEED
3040
1497                         *
3041
1498                         LINEUP  LDD  COLADX   ; GET CURRENT COLUMN AND ROW
3042
1499                                 TSTB          ; AT TOP OF SCREEN ?
3043
1500                                 BEQ  RETESC   ; Yes, Ignore
3044
1501                                 DECB          ; No, Decrement ROW
3045
1502                                 BRA  NEWCUR   ; POSITION CURSOR
3046
1503                         *
3047
1504                         *********************************** BACK SPACE
3048
1505                         *
3049
1506                         BACKSP  LDA  COLADX
3050
1507                                 BEQ  RETESC   ; RETURN
3051
1508                                 DECA
3052
1509                                 BRA  POSCOL   ; POSITION CURSOR
3053
1510                         *
3054
1511                         *********************************** CURSOR RIGHT
3055
1512                         *
3056
1513                         CHRIGHT LDA  COLADX
3057
1514                                 INCA
3058
1515                                 CMPA #LINLEN
3059
1516                                 BEQ  RETESC
3060
1517                                 BRA  POSCOL
3061
1518                         *
3062
1519                         *********************************** CURSOR RIGHT
3063
1520                         *
3064
1521                         HOME    LDD  #0       ; HOME - POSITION TOP OF SCREEN
3065
1522                                 BRA  NEWCUR
3066
1523                         *
3067
1524                         ***************************************************
3068
1525                         *                 ESCAPE HANDLERS                 *
3069
1526                         ***************************************************
3070
1527                         *
3071
1528                         ESCAPE  LDB  ESCFLG   ; GET FLAG
3072
1529                                 CMPB #'=      ; SETTING CURSOR?
3073
1530                                 BEQ  ESCCUR   ; BRANCH IF SO
3074
1531                                 CMPA #'Y      ; CLEAR TO END OF SCREEN?
3075
1532                                 BEQ  ESCCLS
3076
1533                                 CMPA #'T      ; CLEAR TO END OF LINE?
3077
1534                                 BEQ  ESCCLL
3078
1535                                 CMPA #'=      ; STARTING CURSOR SET?
3079
1536                                 BNE  CLRESC   ; BRANCH IF NOT
3080
1537                         *
3081
1538                         ***************************** START ESCAPE SEQUENCE
3082
1539                         *
3083
1540                         SETESC  STA  ESCFLG   ; ELSE START CURSORING
3084
1541                                 RTS           ; AND RETURN
3085
1542                         *
3086
1543                         CLRESC  CLR  ESCFLG   ; NO OTHERS SUPPORTED
3087
1544                         RETESC  RTS           ; SO RETURN
3088
1545                         *
3089
1546                         ********************************* SET SCREEN CURSOR
3090
1547                         *
3091
1548                         ESCCUR  TST  NEWROW   ; ROW SET?
3092
1549                                 BNE  ESCCU1   ; BRANCH IF SO
3093
1550                                 STA  NEWROW   ; ELSE SET NEW ROW
3094
1551                                 RTS           ; AND RETURN
3095
1552                         *
3096
1553                         ESCCU1  CLR  ESCFLG
3097
1554                                 SUBA #$20     ; ADJUST COLUMN ADDRESS
3098
1555                                 CMPA #LINLEN-1 ;CHECK FOR ACCEPTABLE COLUM
3099
1556                                 BHI  RETESC   ; NOT OK, DO NOTHING
3100
1557                         *
3101
1558                         ESCCU2  LDB  NEWROW
3102
1559                                 CLR  NEWROW
3103
1560                                 SUBB #$20     ; ADJUST TO ROW ADDRESS
3104
1561                                 CMPB #NUMLIN-1 ; CHECK FOR ACCEPTABLE ROW
3105
1562                                 BHI  RETESC   ; ELSE RETURN DOING NOTHING
3106
1563                                 BRA  NEWCUR   ; GO SET NEW CURSOR IF SO
3107
1564                         *
3108
1565                         ****************** CLEAR FROM CURSOR TO END OF LINE
3109
1566                         *
3110
1567                         CLRSCR  LDD  #0       ; CLEAR FROM TOP OF SCREEN
3111
1568                                 BSR  NEWCUR
3112
1569                         ESCCLL  LDA  COLADX
3113
1570                                 LDB  #$20     ; AND CLEAR CHAR
3114
1571                         ESCCL1  STB  VDUCHR,X ; DISPLAY TEXT
3115
1572                                 INCA
3116
1573                            STA  VDUCOL,X
3117
1574                                 CMPA #LINLEN  ; UNTIL END OF LINE
3118
1575                                 BNE  ESCCL1
3119
1576                                 CLR  ESCFLG
3120
1577                                 RTS
3121
1578                         *
3122
1579                         *********************************** CARRIAGE RETURN
3123
1580                         *
3124
1581                         CRETN   CLRA          ; SET COLUMN ZERO
3125
1582                         POSCOL  LDB  ROWADX   ; GET CURRENT ROW
3126
1583                         *
3127
1584                         *********** GENERATE NEW CURSOR POSITION AND RETURN
3128
1585                         *
3129
1586                         NEWCUR  STD  COLADX   ; SAVE NEW ROW AND COLUMN
3130
1587                            STA  VDUCOL,X ; SET NEW COLUMN
3131
1588                                 STB  VDUROW,X ; SET NEW ROW
3132
1589                                 RTS           ; AND RETURN
3133
1590                         *
3134
1591                         ********************* UPDATE CURRENT COLUMN AND ROW
3135
1592                         *
3136
1593                         NEWCOL  LDD  COLADX   ; GET ROW AND COLUMN
3137
1594                                 INCA          ; BUMP COLUMN
3138
1595                                 CMPA #LINLEN  ; ROLL?
3139
1596                                 BNE  NEWCUR   ; BRANCH IF NOT
3140
1597                                 CLRA          ; ELSE RESET TO ZERO
3141
1598                                 INCB          ; AND BUMP ROW
3142
1599                                 CMPB #NUMLIN
3143
1600                                 BNE  NEWCUR
3144
1601                                 DECB          ; BOTTOM ROW
3145
1602                                 BSR  NEWCUR
3146
1603                         *
3147
1604                         ********************************* SCROLL THE SCREEN
3148
1605                         *
3149
1606                         SCROLL  LDB  VDUOFF,X
3150
1607                                 INCB
3151
1608                                 CMPB #NUMLIN
3152
1609                                 BLO  SCROL1
3153
1610                                 CLRB
3154
1611                         SCROL1  STB  VDUOFF,X
3155
1612                         *
3156
1613                         **************** CLEAR FROM CURSOR TO END OF SCREEN
3157
1614                         *
3158
1615                         ESCCLS  LDB  COLADX   ; GET CURSOR
3159
1616                                 LDA  #$20     ; GET A SPACE
3160
1617                         ESCCLS1    STB  COLADX
3161
1618                                 STB  VDUCOL,X
3162
1619                                 STA  VDUCHR,X
3163
1620                                 INCB
3164
1621                                 CMPB #LINLEN
3165
1622                                 BNE  ESCCLS1
3166
1623                         *
3167
1624                                 LDB  ROWADX
3168
1625                                 INCB
3169
1626                                 CMPB #NUMLIN
3170
1627                                 BEQ  ESCCLS2
3171
1628                                 STB  ROWADX
3172
1629                                 STB  VDUROW,X
3173
1630                                 CLRB
3174
1631                                 BRA  ESCCLS1
3175
1632                         *
3176
1633                         ESCCLS2 CLRB
3177
1634                                 STB  COLADX
3178
1635                                 STB  VDUCOL,X
3179
1636                                 STB  ESCFLG
3180
1637                                 RTS
3181
1638                                 ENDIF VDUOPT
3182
1638                                 ENDIF VDUOPT
3183
1639                         *
3184
1640                                 IFD DG640OPT
3185
1641                         ***************************************************
3186
1642                         *      TELEVIDEO-TYPE MEMORY-MAPPED EMULATOR      *
3187
1643                         *                                                 *
3188
1644                         * FOR HARD-WIRED MEMORY-MAPPED DISPLAYS USING THE *
3189
1645                         * HIGH ORDER BIT OF EACH BYTE FOR  REVERSE  VIDEO *
3190
1646                         * CURSORING  (SUCH  AS THE THOMAS INSTRUMENTATION *
3191
1647                         * 16x64 BOARD).                                   *
3192
1648                         ***************************************************
3193
1649                         *
3194
1650                         ***************************************************
3195
1651                         *               INITIALIZE EMULATOR               *
3196
1652                         ***************************************************
3197
1653                         *
3198
1654                         VINIZ   LDX  #0
3199
1655                                 STX  COLADX   ; AND ROWADX
3200
1656                                 STX  NEWROW   ; AND ESCFLG
3201
1657                                 LDX  #SCREEN  ; POINT TO SCREEN
3202
1658                                 STX  CURSOR   ; SET PROGRAM CURSOR
3203
1659                                 LDA  #$1B     ; SEND ESCAPE
3204
1660                                 BSR  VOUTCH
3205
1661                                 LDA  #'Y      ; CLEAR TO END OF SCREEN
3206
1662                         *
3207
1663                         ** VIDEO OUTPUT ROUTINE
3208
1664                         *
3209
1665                         VOUTCH  PSHS A,B,X    ; SAVE REGISTERS
3210
1666                         *
3211
1667                         ** CLEAR CURSOR
3212
1668                         *
3213
1669                                 LDX  CURSOR
3214
1670                                 LDB  0,X
3215
1671                                 ANDB #$7F
3216
1672                                 STB  0,X
3217
1673                         *
3218
1674                         ** CHECK FOR ESCAPE SEQUENCE
3219
1675                         *
3220
1676                                 TST  ESCFLG   ; ESCAPE ACTIVE?
3221
1677                                 BEQ  SOROU1   ; BRANCH IF NOT
3222
1678                                 BSR  ESCAPE   ; ELSE DO ESCAPE
3223
1679                                 BRA  RETURN   ; AND RETURN
3224
1680                         *
3225
1681                         ** CHECK FOR CONTROL CHARACTERS
3226
1682                         *
3227
1683                         SOROU1  CMPA #$20     ; CONTROL CODES?
3228
1684                                 BHS  SOROU2
3229
1685                                 BSR  CONTRL   ; BRANCH IF SO
3230
1686                                 BRA  RETURN
3231
1687                         *
3232
1688                         ** OUTPUT TEXT CHARACTER
3233
1689                         *
3234
1690                         SOROU2  LDX  CURSOR   ; ELSE GET CURSOR
3235
1691                                 STA  0,X      ; DISPLAY CHARACTER
3236
1692                                 LBSR NEWCOL   ; UPDATE COLUMN
3237
1693                         *
3238
1694                         ** DISPLAY CURSOR AND RETURN
3239
1695                         *
3240
1696                         RETURN  LDX  CURSOR   ; AND DISPLAY IT
3241
1697                                 LDB  ,X
3242
1698                                 ORB  #$80     ; WITH REVID
3243
1699                                 STB  ,X
3244
1700                                 PULS A,B,X,PC ; RESTORE REGISTERS AND RETURN
3245
1701                         *
3246
1702                         ***************************************************
3247
1703                         *              CONTROL CODE HANDLERS              *
3248
1704                         ***************************************************
3249
1705                         *
3250
1706                         CONTRL  CMPA #$08     ; CTRL H - BACKSPACE ?
3251
1707                                 LBEQ BACKSP
3252
1708                                 CMPA #$1B     ; ESCAPE SEQUENCE?
3253
1709                                 LBEQ SETESC
3254
1710                                 CMPA #$D      ; CTRL M - RETURN?
3255
1711                                 LBEQ CRETN
3256
1712                                 CMPA #$0A     ; CTRL J - LINE FEED
3257
1713                                 BNE  RETESC   ; NONE OF THESE, RETURN
3258
1714                         *
3259
1715                         ***************************************** LINE FEED
3260
1716                         *
3261
1717                         LINEFD  LDD  COLADX   ; GET CURRENT COLUMN AND ROW
3262
1718                                 INCB          ; BUMP ROW
3263
1719                                 CMPB #NUMLIN  ; SCROLL TIME?
3264
1720                                 LBNE NEWCUR   ; POSITION CURSOR IF NOT
3265
1721                                 LBRA SCROLL   ; ELSE SCROLL IT
3266
1722                         *
3267
1723                         ***************************************** LINE FEED
3268
1724                         *
3269
1725                         LINEUP  LDD  COLADX   ; GET CURRENT COLUMN AND ROW
3270
1726                                 TSTB          ; AT TOP OF SCREEN ?
3271
1727                                 BEQ  RETESC   ; YES, RETURN
3272
1728                                 DECB          ; NO, DECREMENT ROW
3273
1729                                 LBRA NEWCUR   ; POSITION CURSOR
3274
1730                         *
3275
1731                         *********************************** BACK SPACE
3276
1732                         *
3277
1733                         BACKSP  LDA  COLADX    ; GET CURRENT COLUMN AND ROW
3278
1734                                 BEQ  RETESC    ; IF AT TOP LEFT CORNER RETURN
3279
1735                                 DECA           ; OTHERWISE BACK STEP ONE CHARACTER
3280
1736                                 LBRA POSCOL    ; POSITION CURSOR
3281
1737                         *
3282
1738                         *********************************** CURSOR RIGHT
3283
1739                         *
3284
1740                         CHRIGHT LDA  COLADX    ; GET CURRENT COLUMN AND ROW
3285
1741                                 INCA           ; MOVE RIGHT ONE CHARACTER
3286
1742                                 CMPA #LINLEN   ; ARE WE AT THE END OF THE LINE ?
3287
1743                                 BEQ  RETESC    ; YES, RETURN
3288
1744                                 LBRA POSCOL    ; NO, POSITION CURSOR
3289
1745                         *
3290
1746                         ***************************************************
3291
1747                         *                 ESCAPE HANDLERS                 *
3292
1748                         ***************************************************
3293
1749                         *
3294
1750                         ESCAPE  LDB  ESCFLG   ; ARE WE IN AN ESCAPE SEQUENCE ?
3295
1751                                 CMPB #'=      ; ARE WE SETTING CURSOR?
3296
1752                                 BEQ  ESCCUR   ; YES BRANCH TO SET CURSOR
3297
1753                                 CMPA #'Y      ; CLEAR TO END OF SCREEN?
3298
1754                                 LBEQ ESCCLS   ; YES, CLEAR SCREEN
3299
1755                                 CMPA #'T      ; CLEAR TO END OF LINE?
3300
1756                                 BEQ  ESCCLL   ; YES, CLEAR LINE
3301
1757                                 CMPA #'E      ; INSERT LINE?
3302
1758                                 BEQ  ESCINL
3303
1759                                 CMPA #'R      ; DELETE LINE?
3304
1760                                 BEQ  ESCDLL
3305
1761                                 CMPA #'=      ; STARTING CURSOR SET?
3306
1762                                 BNE  CLRESC   ; BRANCH IF NOT
3307
1763                         *
3308
1764                         ***************************** START ESCAPE SEQUENCE
3309
1765                         *
3310
1766                         SETESC  STA  ESCFLG   ; ELSE START CURSORING
3311
1767                                 RTS           ; AND RETURN
3312
1768                         *
3313
1769                         CLRESC  CLR  ESCFLG   ; NO OTHERS SUPPORTED
3314
1770                         RETESC  RTS           ;  SO RETURN
3315
1771                         *
3316
1772                         ********************************* SET SCREEN CURSOR
3317
1773                         *
3318
1774                         ESCCUR  TST  NEWROW   ; ROW SET?
3319
1775                                 BNE  ESCCU1   ; BRANCH IF SO
3320
1776                                 STA  NEWROW   ; ELSE SET NEW ROW
3321
1777                                 RTS           ;  AND RETURN
3322
1778                         *
3323
1779                         ESCCU1  CLR  ESCFLG
3324
1780                                 SUBA #$20      ; ADJUST COLUMN ADDRESS
3325
1781                                 CMPA #LINLEN-1 ; CHECK FOR ACCEPTABLE COLUM
3326
1782                                 BHI  RETESC    ; NOT OK, DO NOTHING
3327
1783                         *
3328
1784                         ESCCU2  LDB  NEWROW
3329
1785                                 CLR  NEWROW
3330
1786                                 SUBB #$20      ; ADJUST TO ROW ADDRESS
3331
1787                                 CMPB #NUMLIN-1 ; CHECK FOR ACCEPTABLE ROW
3332
1788                                 BHI  RETESC    ; ELSE RETURN DOING NOTHING
3333
1789                                 BRA  NEWCUR    ; GO SET NEW CURSOR IF SO
3334
1790                         *
3335
1791                         *************************** DELETE LINE FROM SCREEN
3336
1792                         *
3337
1793                         ESCDLL  BSR  CRETN     ; GO COL. ZERO
3338
1794                                 LDB  ROWADX
3339
1795                                 CMPB #NUMLIN-1
3340
1796                                 BEQ  SCROL3
3341
1797                                 BRA  SCROL1    ; AND DELETE THIS LINE
3342
1798                         *
3343
1799                         *************************** INSERT LINE INTO SCREEN
3344
1800                         *
3345
1801                         ESCINL  BSR  CRETN     ; GO TO COL. ZERO
3346
1802                                 LDB  ROWADX
3347
1803                                 CMPB #NUMLIN-1
3348
1804                                 BEQ  ESCCLL
3349
1805                         *
3350
1806                         ** SCROLL SCREEN DOWN FROM CURSOR
3351
1807                         *
3352
1808                                 LDX  #SCREEN+SCNLEN-LINLEN
3353
1809                         ESCIN0  LDA  ,-X
3354
1810                                 STA  LINLEN,X
3355
1811                                 LDA  SCNLEN,X
3356
1812                                 STA  SCNLEN+LINLEN,X
3357
1813                                 CMPX CURSOR
3358
1814                                 BNE  ESCIN0
3359
1815                         *
3360
1816                         ****************** CLEAR FROM CURSOR TO END OF LINE
3361
1817                         *
3362
1818                         ESCCLL  LDA  COLADX    ; GET CURRENT COLUMN
3363
1819                                 LDX  CURSOR    ; GET CURSOR
3364
1820                                 LDB  #$20      ; AND CLEAR CHAR
3365
1821                         ESCLL1  STB  SCNLEN,X  ; CLEAR ATTRIBUTE
3366
1822                                 STB  ,X+       ; CLEAR TEXT
3367
1823                                 INCA
3368
1824                                 CMPA #LINLEN   ; UNTIL END OF LINE
3369
1825                                 BNE  ESCLL1
3370
1826                                 CLR  ESCFLG
3371
1827                                 RTS
3372
1828                         *
3373
1829                         *********************************** CARRIAGE RETURN
3374
1830                         *
3375
1831                         CRETN   CLRA           ; SET COLUMN ZERO
3376
1832                         POSCOL  LDB  ROWADX    ; GET CURRENT ROW
3377
1833                         *
3378
1834                         *********** GENERATE NEW CURSOR POSITION AND RETURN
3379
1835                         *
3380
1836                         NEWCUR  STD  COLADX    ; SAVE NEW ROW AND COLUMN
3381
1837                                 LDA  #LINLEN   ; ELSE ADD A LINE
3382
1838                                 MUL            ; LINLEN * ROWADX
3383
1839                                 ADDB COLADX
3384
1840                                 ADCA #0
3385
1841                                 ADDD #SCREEN   ; ADD SCREEN BASE.
3386
1842                                 STD  CURSOR    ; SAVE NEW CURSOR
3387
1843                                 TFR  D,X       ; GET CURSOR IN X
3388
1844                                 RTS            ; AND RETURN
3389
1845                         *
3390
1846                         ********************* UPDATE CURRENT COLUMN AND ROW
3391
1847                         *
3392
1848                         NEWCOL  LDD  COLADX    ; GET ROW AND COLUMN
3393
1849                                 INCA           ; BUMP COLUMN
3394
1850                                 CMPA #LINLEN   ; ROLL?
3395
1851                                 BNE  NEWCUR    ; BRANCH IF NOT
3396
1852                                 CLRA           ; ELSE RESET TO ZERO
3397
1853                                 INCB           ; AND BUMP ROW
3398
1854                                 CMPB #NUMLIN
3399
1855                                 BNE  NEWCUR
3400
1856                                 DECB           ; BOTTOM ROW
3401
1857                                 BSR  NEWCUR
3402
1858                         *
3403
1859                         ********************************* SCROLL THE SCREEN
3404
1860                         *
3405
1861                         SCROLL  LDX  #SCREEN   ; POINT TO SCREEN
3406
1862                         SCROL1  LDA  SCNLEN+LINLEN,X
3407
1863                                 STA  SCNLEN,X
3408
1864                                 LDA  LINLEN,X  ; MOVE TWO BYTES
3409
1865                                 STA  ,X+       ; UP ONE LINE
3410
1866                                 CMPX #SCREEN+SCNLEN-LINLEN
3411
1867                                 BNE  SCROL1    ; LOOP UNTIL DONE
3412
1868                                 BRA  SCROL3
3413
1869                         *
3414
1870                         **************** CLEAR FROM CURSOR TO END OF SCREEN
3415
1871                         *
3416
1872                         ESCCLS  LDX   CURSOR   ; GET CURSOR
3417
1873                         SCROL3  LDA   #$20     ; GET A SPACE
3418
1874                         SCROL2  STA   SCNLEN,X ; CLEAR ATTRIBUTES
3419
1875                                 STA   ,X+      ; AND TEXT
3420
1876                                 CMPX  #SCREEN+SCNLEN
3421
1877                                 BNE   SCROL2   ; UNTIL DONE
3422
1878                                 CLR   ESCFLG
3423
1879                                 RTS
3424
1880                                 ENDIF DG640OPT
3425
1880                                 ENDIF DG640OPT
3426
1881                         *
3427
1882                                 IFD PRTOPT
3428
1883                         *************************************
3429
1884                         *
3430
1885                         ** PRINTER DRIVER ROUTINES
3431
1886                         *
3432
1887                         *************************************
3433
1888                         *
3434
1889                         ** PINIZ - INITIATE PRINTER PORT
3435
1890                         *
3436
1891                         PINIZ   PSHS B
3437
1892                                 LDD #DIRMSK*256+$04 ; ACCA=DIRMSK ACCB=$04
3438
1893                                 STD PADATA     ; SET DDR AND SELECT DATA
3439
1894                         *
3440
1895                         ** RESET PRINTER
3441
1896                         *
3442
1897                                 LDB  #PRESET
3443
1898                                 STB  PADATA
3444
1899                         RESTLP  INCB           ; DELAY FOR RESET
3445
1900                                 BNE  RESTLP
3446
1901                                 STA  PADATA    ; ACCA=DIRMSK
3447
1902                         *
3448
1903                         ** INITALIZE PORT B (DATA PORT)
3449
1904                         *
3450
1905                                 LDA  #$2A
3451
1906                                 STA  PBCTRL
3452
1907                                 LDD  #$FF2E    ; ACCA=$FF ACCB =%00101110
3453
1908                                 STD  PBDATA    ; PBDREG   PBCTRL
3454
1909                         *
3455
1910                         ** SELECT 66 LINES/PAGE
3456
1911                         *
3457
1912                                 LDA  #$1B
3458
1913                                 BSR  POUTCH
3459
1914                                 LDA  #'C
3460
1915                                 BSR  POUTCH
3461
1916                                 LDA  #66
3462
1917                                 PULS B
3463
1918                         *************************************
3464
1919                         *
3465
1920                         ** OUTPUT A CHARACTER TO THE PRINTER
3466
1921                         *
3467
1922                         *************************************
3468
1923                         POUTCH  PSHS B
3469
1924                                 LDB  PBDATA    ; CLEAR INTERRUPT BIT
3470
1925                         *
3471
1926                         ** WAIT TILL NOT BUSY
3472
1927                         *
3473
1928                         BUSYLP  LDB  PADATA
3474
1929                                 BITB #PERROR
3475
1930                                 BEQ  PEXIT
3476
1931                                 TSTB
3477
1932                                 BMI  BUSYLP
3478
1933                         *
3479
1934                         ** NOW OUTPUT CHARACTER
3480
1935                         *
3481
1936                                 STA  PBDATA
3482
1937                         PEXIT   PULS B,PC
3483
1938                         *************************************
3484
1939                         *
3485
1940                         ** PCHK TEST IFD PRINTER READY
3486
1941                         *
3487
1942                         *************************************
3488
1943                         PCHK    TST  PBCTRL    ; TEST STATE OF CRB7
3489
1944                                 RTS            ; SET ON ACKNOWLEDGE
3490
1945                                 ENDIF PRTOPT
3491
1945                                 ENDIF PRTOPT
3492
1946                         *************************************
3493
1947                         *
3494
1948                         * MONITOR KEYBOARD COMMAND JUMP TABLE
3495
1949                         *
3496
1950                         *************************************
3497
1951                         *
3498
1952 FC49                    JMPTAB  EQU *
3499
1953 FC49 01                         FCB 1 " ^A "
3500
1954 FC4A FA DB                      FDB ALTRA
3501
1955 FC4C 02                         FCB 2 " ^B "
3502
1956 FC4D FA D0                      FDB ALTRB
3503
1957 FC4F 03                         FCB 3 " ^C "
3504
1958 FC50 FA E6                      FDB ALTRCC
3505
1959 FC52 04                         FCB 4 " ^D "
3506
1960 FC53 FA C5                      FDB ALTRDP
3507
1961 FC55 10                         FCB $10 " ^P "
3508
1962 FC56 FA 98                      FDB ALTRPC
3509
1963 FC58 15                         FCB $15 " ^U "
3510
1964 FC59 FA A4                      FDB ALTRU
3511
1965 FC5B 18                         FCB $18 " ^X "
3512
1966 FC5C FA BA                      FDB ALTRX
3513
1967 FC5E 19                         FCB $19 " ^Y "
3514
1968 FC5F FA AF                      FDB ALTRY
3515
1969                         *
3516
1970 FC61 42                         FCC 'B'
3517
1971 FC62 F9 43                      FDB BRKPNT
3518
1972 FC64 45                         FCC 'E'
3519
1973 FC65 F8 E4                      FDB MEMDUMP
3520
1974 FC67 47                         FCC 'G'
3521
1975 FC68 F8 8C                      FDB GO
3522
1976 FC6A 4C                         FCC 'L'
3523
1977 FC6B F9 C5                      FDB LOAD
3524
1978 FC6D 50                         FCC 'P'
3525
1979 FC6E FA 23                      FDB PUNCH
3526
1980 FC70 4D                         FCC 'M'
3527
1981 FC71 F8 8F                      FDB MEMCHG
3528
1982 FC73 52                         FCC 'R'
3529
1983 FC74 FB 54                      FDB REGSTR
3530
1984 FC76 53                         FCC 'S'
3531
1985 FC77 F8 D8                      FDB DISSTK
3532
1986 FC79 58                         FCC 'X'
3533
1987 FC7A F9 6F                      FDB XBKPNT
3534
1988                                 IFD MFDCOPT
3535
1989                                 FCC 'D'        ; *** SWTPC USES 'U' FOR MINIBOOT
3536
1990                                 FDB MINBOOT
3537
1991                                 ENDIF MFDCOPT
3538
1991                                 ENDIF MFDCOPT
3539
1992                                 IFD CF8OPT
3540
1993                                 FCC 'D'        ; *** FPGA 8 BIT USES 'D' FOR CFBOOT
3541
1994                                 FDB CFBOOT
3542
1995                                 ENDIF CF8OPT
3543
1995                                 ENDIF CF8OPT
3544
1996                                 IFD IDEOPT
3545
1997                                 FCC 'D'        ; *** XESS FPGA 16 BIT IDE USES 'D' FOR IDEBOOT
3546
1998                                 FDB IDEBOOT
3547
1999                                 ENDIF IDEOPT
3548
1999                                 ENDIF IDEOPT
3549
2000                                 IFD DMAFOPT
3550
2001                                 FCC 'U'        ; *** SWTPC USES 'D' FOR DMAF2 BOOT
3551
2002                                 FDB DBOOT
3552
2003                                 ENDIF DMAFOPT
3553
2003                                 ENDIF DMAFOPT
3554
2004                                 IFD EXTOPT
3555
2005                                 FCC 'U'        ; *** IF FPGA, 'U' IS FOR USER
3556
2006                                 FDB USRCMD
3557
2007                                 ENDIF EXTOPT
3558
2007                                 ENDIF EXTOPT
3559
2008                                 IFD RTCOPT
3560
2009                                 FCC 'T'
3561
2010                                 FDB TIMSET
3562
2011                                 ENDIF RTCOPT
3563
2011                                 ENDIF RTCOPT
3564
2012                                 IFD TRAOPT
3565
2013                                 FCC "T"
3566
2014                                 FDB TRACE
3567
2015                                 ENDIF TRAOPT
3568
2015                                 ENDIF TRAOPT
3569
2016                         *
3570
2017 FC7C                    TABEND  EQU *
3571
2018                         *
3572
2019                         * ** 6809 VECTOR ADDRESSES **
3573
2020                         *
3574
2021                         * FOLLOWING ARE THE ADDRESSES OF THE VECTOR ROUTINES
3575
2022                         * FOR THE 6809 PROCESSOR. DURING INITIALIZATION THEY
3576
2023                         * ARE RELOCATED TO RAM FROM $DFC0 TO $DFCF. THEY ARE
3577
2024                         * RELOCATED TO RAM SO THAT THE USER MAY REVECTOR TO
3578
2025                         * HIS OWN ROUTINES IF HE SO DESIRES.
3579
2026                         *
3580
2027                         *
3581
2028 FC7C F9 7B              RAMVEC  FDB SWIE       ; USER-V
3582
2029 FC7E F8 8E                      FDB RTI        ; SWI3-V
3583
2030 FC80 F8 8E                      FDB RTI        ; SWI2-V
3584
2031 FC82 F8 8E                      FDB RTI        ; FIRQ-V
3585
2032 FC84 F8 8E                      FDB RTI        ; IRQ-V
3586
2033 FC86 F9 7B                      FDB SWIE       ; SWI-V
3587
2034 FC88 FF FF                      FDB $FFFF      ; SVC-VO
3588
2035 FC8A FF FF                      FDB $FFFF      ; SVC-VL
3589
2036                         *
3590
2037                         * PRINTABLE MESSAGE STRINGS
3591
2038                         *
3592
2039 FC8C 0D 0A 00 00 00     MSG1    FCB  $D,$A,$0,$0,$0 * 0, CR/LF, 0
3593
2040 FC91 53 79 73 30 39 42          FCC  'Sys09Bug 1.7 FOR '
3594
          75 67 20 31 2E 37
3595
          20 46 4F 52 20
3596
2041                                 IFD  SWTOPT
3597
2042                                 FCC  'SWTPC'
3598
2043                                 ENDIF SWTOPT
3599
2043                                 ENDIF SWTOPT
3600
2044                                 IFD  ADSOPT
3601
2045                                 FCC  'ADS6809'
3602
2046                                 ENDIF ADSOPT
3603
2046                                 ENDIF ADSOPT
3604
2047                                 IFD  B3SOPT
3605
2048                                 FCC  'B3-S2+'
3606
2049                                 ENDIF B3SOPT
3607
2049                                 ENDIF B3SOPT
3608
2050                                 IFD  B5XOPT
3609
2051                                 FCC  'B5-X300'
3610
2052                                 ENDIF B5XOPT
3611
2052                                 ENDIF B5XOPT
3612
2053                                 IFD  S3SOPT
3613
2054                                 FCC  'S3STARTER'
3614
2055                                 ENDIF S3SOPT
3615
2055                                 ENDIF S3SOPT
3616
2056                                 IFD  S3EOPT
3617
2057                                 FCC  'S3E'
3618
2058                                 ENDIF S3EOPT
3619
2058                                 ENDIF S3EOPT
3620
2059                                 IFD  XESOPT
3621
2060                                 FCC  'XESS'
3622
2061                                 ENDIF XESOPT
3623
2061                                 ENDIF XESOPT
3624
2062                                 IFD  ATLYSOPT
3625
2063                                 FCC  'Atlys'
3626
2064                                 ENDIF ATLYSOPT
3627
2064                                 ENDIF ATLYSOPT
3628
2065                                 IFD  DE270OPT
3629
2066                                 FCC  'DE2-70'
3630
2067                                 ENDIF DE270OPT
3631
2067                                 ENDIF DE270OPT
3632
2068 FCA2 20 2D 20                   FCC ' - '
3633
2069 FCA5 04                         FCB 4
3634
2070 FCA6 4B 0D 0A 00 00 00  MSG2    FCB 'K,$0D,$0A,$00,$00,$00,$04 ; K,,,3 NULS,
3635
          04
3636
2071 FCAD 3E                 MSG3    FCC '>'
3637
2072 FCAE 04                         FCB 4
3638
2073 FCAF 57 48 41 54 3F     MSG4    FCC 'WHAT?'
3639
2074 FCB4 04                         FCB 4
3640
2075 FCB5 20 2D 20           MSG5    FCC ' - '
3641
2076 FCB8 04                         FCB 4'
3642
2077 FCB9 20 20 53 50 3D     MSG10   FCC '  SP='
3643
2078 FCBE 04                         FCB 4
3644
2079 FCBF 20 20 50 43 3D     MSG11   FCC '  PC='
3645
2080 FCC4 04                         FCB 4
3646
2081 FCC5 20 20 55 53 3D     MSG12   FCC '  US='
3647
2082 FCCA 04                         FCB 4
3648
2083 FCCB 20 20 49 59 3D     MSG13   FCC '  IY='
3649
2084 FCD0 04                         FCB 4
3650
2085 FCD1 20 20 49 58 3D     MSG14   FCC '  IX='
3651
2086 FCD6 04                         FCB 4
3652
2087 FCD7 20 20 44 50 3D     MSG15   FCC '  DP='
3653
2088 FCDC 04                         FCB 4
3654
2089 FCDD 20 20 41 3D        MSG16   FCC '  A='
3655
2090 FCE1 04                         FCB 4
3656
2091 FCE2 20 20 42 3D        MSG17   FCC '  B='
3657
2092 FCE6 04                         FCB 4
3658
2093 FCE7 20 20 43 43 3A 20  MSG18   FCC '  CC: '
3659
2094 FCED 04                         FCB 4
3660
2095 FCEE 45 46 48 49 4E 5A  MSG19   FCC 'EFHINZVC'
3661
          56 43
3662
2096 FCF6 53 31              MSG20   FCC 'S1'
3663
2097 FCF8 04                         FCB 4
3664
2098                                 IFD DATOPT
3665
2099                         *
3666
2100                         * POWER UP/ RESET/ NMI ENTRY POINT
3667
2101                         *
3668
2102                                 ORG $FF00
3669
2103                         *
3670
2104                         *
3671
2105                         START   LDX  #IC11    ; POINT TO DAT RAM IC11
3672
2106                                 LDA  #$0F     ; GET COMPLIMENT OF ZERO
3673
2107                         *
3674
2108                         *
3675
2109                         * INITIALIZE DAT RAM --- LOADS $F-$0 IN LOCATIONS $0-$F
3676
2110                         * OF DAT RAM, THUS STORING COMPLEMENT OF MSB OF ADDRESS
3677
2111                         * IN THE DAT RAM. THE COMPLEMENT IS REQUIRED BECAUSE THE
3678
2112                         * OUTPUT OF IC11, A 74S189, IS THE INVERSE OF THE DATA
3679
2113                         * STORED IN IT.
3680
2114                         *
3681
2115                         *
3682
2116                         DATLP   STA  ,X+       ; STORE & POINT TO NEXT RAM LOCATION
3683
2117                                 DECA           ; GET COMP. VALUE FOR NEXT LOCATION
3684
2118                                 BNE  DATLP     ; ALL 16 LOCATIONS INITIALIZED ?
3685
2119                         *
3686
2120                         * NOTE: IX NOW CONTAINS $0000, DAT RAM IS NO LONGER
3687
2121                         *       ADDRESSED, AND LOGICAL ADDRESSES NOW EQUAL
3688
2122                         *       PHYSICAL ADDRESSES.
3689
2123                         *
3690
2124                                 LDA  #$F0
3691
2125                                 STA  ,X        ; STORE $F0 AT $FFFF
3692
2126                                 LDX  #$D0A0    ; ASSUME RAM TO BE AT $D000-$DFFF
3693
2127                                 LDY  #TSTPAT   ; LOAD TEST DATA PATTERN INTO "Y"
3694
2128                         TSTRAM  LDU  ,X        ; SAVE DATA FROM TEST LOCATION
3695
2129                                 STY  ,X        ; STORE TEST PATTERN AT $D0A0
3696
2130                                 CMPY ,X        ; IS THERE RAM AT THIS LOCATION ?
3697
2131                                 BEQ  CNVADR    ; IF MATCH THERE'S RAM, SO SKIP
3698
2132                                 LEAX -$1000,X  ; ELSE POINT 4K LOWER
3699
2133                                 CMPX #$F0A0    ; DECREMENTED PAST ZER0 YET ?
3700
2134                                 BNE  TSTRAM    ; IF NOT CONTINUE TESTING FOR RAM
3701
2135                                 BRA  START     ; ELSE START ALL OVER AGAIN
3702
2136                         *
3703
2137                         *
3704
2138                         * THE FOLLOWING CODE STORES THE COMPLEMENT OF
3705
2139                         * THE MS CHARACTER OF THE FOUR CHARACTER HEX
3706
2140                         * ADDRESS OF THE FIRST 4K BLOCK OF RAM LOCATED
3707
2141                         * BY THE ROUTINE "TSTRAM" INTO THE DAT RAM. IT
3708
2142                         * IS STORED IN RAM IN THE LOCATION THAT IS
3709
2143                         * ADDRESSED WHEN THE PROCESSOR ADDRESS IS $D---,
3710
2144                         * THUS IF THE FIRST 4K BLOCK OF RAM IS FOUND
3711
2145                         * WHEN TESTING LOCATION $70A0, MEANING THERE
3712
2146                         * IS NO RAM PHYSICALLY ADDRESSED IN THE RANGE
3713
2147                         * $8000-$DFFF, THEN THE COMPLEMENT OF THE
3714
2148                         * "7" IN THE $70A0 WILL BE STORED IN
3715
2149                         * THE DAT RAM. THUS WHEN THE PROCESSOR OUTPUTS
3716
2150                         * AN ADDRESS OF $D---, THE DAT RAM WILL RESPOND
3717
2151                         * BY RECOMPLEMENTING THE "7" AND OUTPUTTING THE
3718
2152                         * 7 ONTO THE A12-A15 ADDRESS LINES. THUS THE
3719
2153                         * RAM THAT IS PHYSICALLY ADDRESSED AT $7---
3720
2154                         * WILL RESPOND AND APPEAR TO THE 6809 THAT IT
3721
2155                         * IS AT $D--- SINCE THAT IS THE ADDRESS THE
3722
2156                         * 6809 WILL BE OUTPUTING WHEN THAT 4K BLOCK
3723
2157                         * OF RAM RESPONDS.
3724
2158                         *
3725
2159                         *
3726
2160                         CNVADR  STU  ,X        ; RESTORE DATA AT TEST LOCATION
3727
2161                                 TFR  X,D       ; PUT ADDR. OF PRESENT 4K BLOCK IN D
3728
2162                                 COMA           ; COMPLEMENT MSB OF THAT ADDRESS
3729
2163                                 LSRA           ; PUT MS 4 BITS OF ADDRESS IN
3730
2164                                 LSRA           ; LOCATION D0-D3 TO ALLOW STORING
3731
2165                                 LSRA           ; IT IN THE DYNAMIC ADDRESS
3732
2166                                 LSRA           ; TRANSLATION RAM.
3733
2167                                 STA  $FFFD     ; STORE XLATION FACTOR IN DAT "D"
3734
2168                         *
3735
2169                                 LDS  #STACK    ; INITIALIZE STACK POINTER
3736
2170                         *
3737
2171                         *
3738
2172                         * THE FOLLOWING CHECKS TO FIND THE REAL PHYSICAL ADDRESSES
3739
2173                         * OF ALL 4K BLKS OF RAM IN THE SYSTEM. WHEN EACH 4K BLK
3740
2174                         * OF RAM IS LOCATED, THE COMPLEMENT OF IT'S REAL ADDRESS
3741
2175                         * IS THEN STORED IN A "LOGICAL" TO "REAL" ADDRESS XLATION
3742
2176                         * TABLE THAT IS BUILT FROM $DFD0 TO $DFDF. FOR EXAMPLE IF
3743
2177                         * THE SYSTEM HAS RAM THAT IS PHYSICALLY LOCATED (WIRED TO
3744
2178                         * RESPOND) AT THE HEX LOCATIONS $0--- THRU $F---....
3745
2179                         *
3746
2180                         *  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
3747
2181                         * 4K 4K 4K 4K 4K 4K 4K 4K -- 4K 4K 4K 4K -- -- --
3748
2182                         *
3749
2183                         * ....FOR A TOTAL OF 48K OF RAM, THEN THE TRANSLATION TABLE
3750
2184                         * CREATED FROM $DFD0 TO $DFDF WILL CONSIST OF THE FOLLOWING....
3751
2185                         *
3752
2186                         *  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
3753
2187                         * 0F 0E 0D 0C 0B 0A 09 08 06 05 00 00 04 03 F1 F0
3754
2188                         *
3755
2189                         *
3756
2190                         * HERE WE SEE THE LOGICAL ADDRESSES OF MEMORY FROM $0000-$7FFF
3757
2191                         * HAVE NOT BEEN SELECTED FOR RELOCATION SO THAT THEIR PHYSICAL
3758
2192                         * ADDRESS WILL = THEIR LOGICAL ADDRESS; HOWEVER, THE 4K BLOCK
3759
2193                         * PHYSICALLY AT $9000 WILL HAVE ITS ADDRESS TRANSLATED SO THAT
3760
2194                         * IT WILL LOGICALLY RESPOND AT $8000. LIKEWISE $A,$B, AND $C000
3761
2195                         * WILL BE TRANSLATED TO RESPOND TO $9000,$C000, AND $D000
3762
2196                         * RESPECTIVELY. THE USER SYSTEM WILL LOGICALLY APPEAR TO HAVE
3763
2197                         * MEMORY ADDRESSED AS FOLLOWS....
3764
2198                         *
3765
2199                         *  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
3766
2200                         * 4K 4K 4K 4K 4K 4K 4K 4K 4K 4K -- -- 4K 4K -- --
3767
2201                         *
3768
2202                         *
3769
2203                                 LDY  #LRARAM   ; POINT TO LOGICAL/REAL ADDR. TABLE
3770
2204                                 STA  13,Y      ; STORE $D--- XLATION FACTOR AT $DFDD
3771
2205                                 CLR  14,Y      ; CLEAR $DFDE
3772
2206                                 LDA  #$F0      ; DESTINED FOR IC8 AN MEM EXPANSION ?
3773
2207                                 STA  15,Y      ; STORE AT $DFDF
3774
2208                                 LDA  #$0C      ; PRESET NUMBER OF BYTES TO CLEAR
3775
2209                         CLRLRT  CLR  A,Y       ; CLEAR $DFDC THRU $DFD0
3776
2210                                 DECA           ; SUB. 1 FROM BYTES LEFT TO CLEAR
3777
2211                                 BPL  CLRLRT    ; CONTINUE IF NOT DONE CLEARING
3778
2212                         FNDRAM  LEAX -$1000,X  ; POINT TO NEXT LOWER 4K OF RAM
3779
2213                                 CMPX #$F0A0    ; TEST FOR DECREMENT PAST ZERO
3780
2214                                 BEQ  FINTAB    ; SKIP IF FINISHED
3781
2215                                 LDU  ,X        ; SAVE DATA AT CURRENT TEST LOCATION
3782
2216                                 LDY  #TSTPAT   ; LOAD TEST DATA PATTERN INTO Y REG.
3783
2217                                 STY  ,X        ; STORE TEST PATT. INTO RAM TEST LOC.
3784
2218                                 CMPY ,X        ; VERIFY RAM AT TEST LOCATION
3785
2219                                 BNE  FNDRAM    ; IF NO RAM GO LOOK 4K LOWER
3786
2220                                 STU  ,X        ; ELSE RESTORE DATA TO TEST LOCATION
3787
2221                                 LDY  #LRARAM   ; POINT TO LOGICAL/REAL ADDR. TABLE
3788
2222                                 TFR  X,D       ; PUT ADDR. OF PRESENT 4K BLOCK IN D
3789
2223                                 LSRA           ; PUT MS 4 BITS OF ADDR. IN LOC. D0-D3
3790
2224                                 LSRA           ; TO ALLOW STORING IT IN THE DAT RAM.
3791
2225                                 LSRA
3792
2226                                 LSRA
3793
2227                                 TFR  A,B       ; SAVE OFFSET INTO LRARAM TABLE
3794
2228                                 EORA #$0F      ; INVERT MSB OF ADDR. OF CURRENT 4K BLK
3795
2229                                 STA  B,Y       ; SAVE TRANSLATION FACTOR IN LRARAM TABLE
3796
2230                                 BRA  FNDRAM    ; GO TRANSLATE ADDR. OF NEXT 4K BLK
3797
2231                         FINTAB  LDA  #$F1      ; DESTINED FOR IC8 AND MEM EXPANSION ?
3798
2232                                 LDY  #LRARAM   ; POINT TO LRARAM TABLE
3799
2233                                 STA  14,Y      ; STORE $F1 AT $DFCE
3800
2234                         *
3801
2235                         * THE FOLLOWING CHECKS TO SEE IF THERE IS A 4K BLK OF
3802
2236                         * RAM LOCATED AT $C000-$CFFF. IF NONE THERE IT LOCATES
3803
2237                         * THE NEXT LOWER 4K BLK AN XLATES ITS ADDR SO IT
3804
2238                         * LOGICALLY RESPONDS TO THE ADDRESS $C---.
3805
2239                         *
3806
2240                         *
3807
2241                                 LDA  #$0C      ; PRESET NUMBER HEX "C"
3808
2242                         FINDC   LDB  A,Y       ; GET ENTRY FROM LRARAM TABLE
3809
2243                                 BNE  FOUNDC    ; BRANCH IF RAM THIS PHYSICAL ADDR.
3810
2244                                 DECA           ; ELSE POINT 4K LOWER
3811
2245                                 BPL  FINDC     ; GO TRY AGAIN
3812
2246                                 BRA  XFERTF
3813
2247                         FOUNDC  CLR  A,Y       ; CLR XLATION FACTOR OF 4K BLOCK FOUND
3814
2248                                 STB  $0C,Y     ; GIVE IT XLATION FACTOR MOVING IT TO $C---
3815
2249                         *
3816
2250                         * THE FOLLOWING CODE ADJUSTS THE TRANSLATION
3817
2251                         * FACTORS SUCH THAT ALL REMAINING RAM WILL
3818
2252                         * RESPOND TO A CONTIGUOUS BLOCK OF LOGICAL
3819
2253                         * ADDRESSES FROM $0000 AND UP....
3820
2254                         *
3821
2255                                 CLRA           ; START AT ZERO
3822
2256                                 TFR  Y,X       ; START POINTER "X" START OF "LRARAM" TABLE.
3823
2257                         COMPRS  LDB  A,Y       ; GET ENTRY FROM "LRARAM" TABLE
3824
2258                                 BEQ  PNTNXT    ; IF IT'S ZER0 SKIP
3825
2259                                 CLR  A,Y       ; ELSE ERASE FROM TABLE
3826
2260                                 STB  ,X+       ; AND ENTER ABOVE LAST ENTRY- BUMP
3827
2261                         PNTNXT  INCA           ; GET OFFSET TO NEXT ENTRY
3828
2262                                 CMPA #$0C      ; LAST ENTRY YET ?
3829
2263                                 BLT  COMPRS
3830
2264                         *
3831
2265                         * THE FOLLOWING CODE TRANSFER THE TRANSLATION
3832
2266                         * FACTORS FROM THE LRARAM TABLE TO IC11 ON
3833
2267                         * THE MP-09 CPU CARD.
3834
2268                         *
3835
2269                         XFERTF  LDX  #IC11     ; POINT TO DAT RAM IC11
3836
2270                                 LDB  #$10      ; GET NO. OF BYTES TO MOVE
3837
2271                         FETCH   LDA  ,Y+       ; GET BYTE AND POINT TO NEXT
3838
2272                                 STA  ,X+       ; POKE XLATION FACTOR IN IC11
3839
2273                                 DECB           ; SUB 1 FROM BYTES TO MOVE
3840
2274                                 BNE  FETCH     ; CONTINUE UNTIL 16 MOVED
3841
2275                         *
3842
2276                                 ELSE
3843
2277 FCF9 39                 LRA     RTS
3844
2278 FCFA 10 CE DF C0        START   LDS  #STACK    ; INITIALIZE STACK POINTER
3845
2279 FCFE 5F                         CLRB
3846
2280                                 ENDIF DATOPT
3847
2281                         *
3848
2282 FCFF 53                         COMB           ; SET "B" NON-ZERO
3849
2283 FD00 F7 DF D2                   STB  ECHO      ; TURN ON ECHO FLAG
3850
2284 FD03 16 FB 0E                   LBRA MONITOR   ; INITIALIZATION IS COMPLETE
3851
2285                         *
3852
2286                         ** INTERRUPT JUMP VECTORS
3853
2287                         *
3854
2288 FD06 6E 9F DF C0        V1      JMP  [STACK]
3855
2289 FD0A 6E 9F DF C4        V2      JMP  [SWI2]
3856
2290 FD0E 6E 9F DF C6        V3      JMP  [FIRQ]
3857
2291 FD12 6E 9F DF C8        V4      JMP  [IRQ]
3858
2292 FD16 6E 9F DF CA        V5      JMP  [SWI]
3859
2293                         *
3860
2294                         * SWI3 ENTRY POINT
3861
2295                         *
3862
2296 FD1A 1F 43              SWI3E   TFR  S,U
3863
2297 FD1C AE 4A                      LDX  10,U      *$FFC8
3864
2298 FD1E E6 80                      LDB  ,X+
3865
2299 FD20 AF 4A                      STX  10,U
3866
2300 FD22 4F                         CLRA
3867
2301 FD23 58                         ASLB
3868
2302 FD24 49                         ROLA
3869
2303 FD25 BE DF CC                   LDX  SVCVO
3870
2304 FD28 8C FF FF                   CMPX #$FFFF
3871
2305 FD2B 27 0F                      BEQ  SWI3Z
3872
2306 FD2D 30 8B                      LEAX D,X
3873
2307 FD2F BC DF CE                   CMPX SVCVL
3874
2308 FD32 22 08                      BHI  SWI3Z
3875
2309 FD34 34 10                      PSHS X
3876
2310 FD36 EC C4                      LDD  ,U
3877
2311 FD38 AE 44                      LDX  4,U
3878
2312 FD3A 6E F1                      JMP  [,S++]
3879
2313 FD3C 37 1F              SWI3Z   PULU A,B,X,CC,DP
3880
2314 FD3E EE 42                      LDU  2,U
3881
2315 FD40 6E 9F DF C2                JMP  [SWI3]
3882
2316                         *
3883
2317                         * 6809 VECTORS
3884
2318                         *
3885
2319 FFF0                            ORG $FFF0
3886
2320 FFF0 FD 06                      FDB V1    USER-V
3887
2321 FFF2 FD 1A                      FDB SWI3E SWI3-V
3888
2322 FFF4 FD 0A                      FDB V2    SWI2-V
3889
2323 FFF6 FD 0E                      FDB V3    FIRQ-V
3890
2324 FFF8 FD 12                      FDB V4    IRQ-V
3891
2325 FFFA FD 16                      FDB V5    SWI-V
3892
2326 FFFC FD 06                      FDB V1    NMI-V
3893
2327 FFFE FC FA                      FDB START RESTART-V
3894
0005                                 END START
3895
0006                          END
3896
Program + Init Data = 2898 bytes
3897
Error count = 0
3898
 
3899
 
3900
ACIAC1     0000
3901
ACIAD1     0001
3902
ACINIZ     FC36
3903
ACIRST     01F7
3904
ACK        0006
3905
AJDUMP     F8F0
3906
ALTAD      FAE5
3907
ALTBD      FADA
3908
ALTCCD     FAF2
3909
ALTDPD     FACF
3910
ALTPC1     FA9B
3911
ALTPCD     FAA3
3912
ALTRA      FADB
3913
ALTRB      FAD0
3914
ALTRCC     FAE6
3915
ALTRDP     FAC5
3916
ALTRPC     FA98
3917
ALTRU      FAA4
3918
ALTRX      FABA
3919
ALTRY      FAAF
3920
ALTUD      FAAE
3921
ALTXD      FAC4
3922
ALTYD      FAB9
3923
AOUTCH     FC21
3924
ATLOPT     00FF
3925
BACK       F8D4
3926
BIASCI     FBE4
3927
BLKNUM     0104
3928
BLOAD0     070D
3929
BLOAD1     071B
3930
BLOAD2     0731
3931
BLOAD3     0745
3932
BOOT       0700
3933
BPADJ      F9B9
3934
BPERR      F967
3935
BPTBL      DFD3
3936
BPTEST     F9A9
3937
BRKPNT     F943
3938
BSSTACK    C0FF
3939
BUFFER     0200
3940
BYTCNT     0105
3941
BYTE       FB8D
3942
CAN        0018
3943
CFLAG      0001
3944
CHANGE     F8C2
3945
CHKDRV     053B
3946
CHKSUM     0103
3947
CHRTN      F8C1
3948
CLRSTK     F82F
3949
CPORT      DFD0
3950
DELCNT     0108
3951
DELCON     04E2
3952
DFL1       0115
3953
DFL2       0122
3954
DFL3       0136
3955
DFL4       01A0
3956
DISFOS     0085
3957
DISSTK     F8D8
3958
DLY        F9BC
3959
DNS        0707
3960
DRNUM      070C
3961
DRVNUM     0100
3962
DRVS2      0536
3963
DRVSEL     052F
3964
ECHO       DFD2
3965
ECHON      FBF9
3966
EDPASC     F92F
3967
EDPRTN     F8EF
3968
EDUMP      F90B
3969
EFLAG      0080
3970
ELOOP      F91D
3971
EOT        0004
3972
EXITBP     F966
3973
EXTEND     0035
3974
EXTTAB     002C
3975
FETSTA     FC26
3976
FFLAG      0040
3977
FFSTBL     F9A0
3978
FIRQ       DFC6
3979
FNDBP      F9AF
3980
FORWRD     F8D0
3981
GETCH      0752
3982
GETCH2     0758
3983
GETCH4     0767
3984
GETST1     FC0F
3985
GETSTA     FC06
3986
GO         F88C
3987
GOFLEX     076A
3988
HFLAG      0020
3989
IFLAG      0010
3990
IN1ADR     FB7D
3991
IN2ADR     FB72
3992
INCH       FC04
3993
INCHE      FBFE
3994
INCHEK     FC13
3995
INCHEK1    FC1B
3996
INCHEV     F806
3997
INCHKV     F808
3998
INCHV      F804
3999
INHEX      FBA0
4000
INHEXA     FBAD
4001
INHEXL     FBB8
4002
INITDR     04B2
4003
INTER      0200
4004
INTER0     020B
4005
INTER1     0219
4006
INTER2     021E
4007
INTEST     01F2
4008
IOINIZ     FC36
4009
IRQ        DFC8
4010
JBYTE      FA92
4011
JIN1ADR    FA95
4012
JMPCMD     F888
4013
JMPEXT     002A
4014
JMPTAB     FC49
4015
JOUT1S     FA8F
4016
JOUT2H     FB17
4017
JOUT4H     FB04
4018
LADR       070A
4019
LOAD       F9C5
4020
LOAD1      F9D0
4021
LOAD10     F9FA
4022
LOAD16     FA10
4023
LOAD2      F9D3
4024
LOAD21     FA1B
4025
LODERR     FA0F
4026
LOOPA      F81D
4027
LRA        FCF9
4028
LRAV       F812
4029
MAXSEC     010C
4030
MAXTRK     010B
4031
MDUMP1     F8E9
4032
MEMC2      F896
4033
MEMCHG     F88F
4034
MEMDUMP    F8E4
4035
MESS6      00AE
4036
MONIO      E000
4037
MONITOR    F814
4038
MONITV     F800
4039
MONRAM     DFC0
4040
MONROM     F800
4041
MSG1       FC8C
4042
MSG10      FCB9
4043
MSG11      FCBF
4044
MSG12      FCC5
4045
MSG13      FCCB
4046
MSG14      FCD1
4047
MSG15      FCD7
4048
MSG16      FCDD
4049
MSG17      FCE2
4050
MSG18      FCE7
4051
MSG19      FCEE
4052
MSG2       FCA6
4053
MSG20      FCF6
4054
MSG3       FCAD
4055
MSG4       FCAF
4056
MSG5       FCB5
4057
MSGWHAT    0035
4058
NAK        0015
4059
NEXTCMD    F848
4060
NEXTEXT    0002
4061
NFLAG      0008
4062
NMI        DFC0
4063
NOTHEX     FBC3
4064
NXTCH0     F872
4065
NXTCHR     F875
4066
NXTCMV     F802
4067
NXTEX0     0016
4068
NXTEX1     0019
4069
NXTLIN     F8FF
4070
OUT1S      FC1F
4071
OUT2H      FBCE
4072
OUT2S      FC1D
4073
OUT4H      FBC6
4074
OUTBA      FBE8
4075
OUTC       FBE2
4076
OUTCH      FC21
4077
OUTCHV     F80A
4078
OUTHL      FBCE
4079
OUTHR      FBD6
4080
OUTTE1     0233
4081
OUTTE2     0241
4082
OUTTER     0231
4083
PCLKHI     0001
4084
PCLKLO     0000
4085
PCRLF      FA85
4086
PCRLFV     F80E
4087
PDATA      FAF6
4088
PDATA0     0246
4089
PDATA1     0248
4090
PDATAV     F80C
4091
PERIOD     F939
4092
PRASC      F93B
4093
PRINT      FAF3
4094
PROMREG    E0C0
4095
PRSTHI     0002
4096
PRSTLO     0000
4097
PRTA       FB35
4098
PRTB       FB3E
4099
PRTBA      FBF0
4100
PRTCC      FB47
4101
PRTCMD     F866
4102
PRTDP      FB10
4103
PRTIX      FB1A
4104
PRTIY      FB23
4105
PRTPC      FB2C
4106
PRTSP      FAFD
4107
PRTUS      FB07
4108
PSTRGV     F810
4109
PSTRNG     FA81
4110
PUNCH      FA23
4111
PUNCH2     FA3C
4112
PUNCH3     FA48
4113
PUNCH4     FA4A
4114
PUNCHL     FA62
4115
PUNEXT     FA79
4116
RAMVEC     FC7C
4117
RCHAR      0046
4118
RCHAR1     004B
4119
RCHAR2     004F
4120
RCHAR3     005E
4121
RDLP1      04F7
4122
READ       0787
4123
READ1      0797
4124
READSC     04E6
4125
REGPR      F989
4126
REGSTR     FB54
4127
RESTR1     04C7
4128
RF3        01D7
4129
RMAXSEC    00FF
4130
RMAXTRK    0100
4131
RPLSWI     F98F
4132
RTI        F88E
4133
RTOTSEC    FE01
4134
SCHAR      0062
4135
SCHAR1     0069
4136
SCHAR2     006D
4137
SCHAR3     007F
4138
SCT        0706
4139
SCTBUF     C300
4140
SECTOR     0102
4141
SEEK       076D
4142
SEEKTS     04CC
4143
SKPDMP     F908
4144
SOH        0001
4145
STACK      DFC0
4146
START      FCFA
4147
SUB1       F9C0
4148
SVCVL      DFCE
4149
SVCVO      DFCC
4150
SWI        DFCA
4151
SWI2       DFC4
4152
SWI3       DFC2
4153
SWI3E      FD1A
4154
SWI3Z      FD3C
4155
SWIE       F97B
4156
SYNCHI     AA55
4157
SYNCLO     FF00
4158
TABEND     FC7C
4159
TADR       0708
4160
TRACK      0101
4161
TRK        0705
4162
UBSUB      003E
4163
UFEXIT     01EC
4164
UFMSG1     00CB
4165
UFSUB      00E6
4166
UFSUB1     00EF
4167
UXERR      03FF
4168
UXEXIT     03F9
4169
UXLOOP     03AD
4170
UXMES0     024F
4171
UXMES1     0268
4172
UXMES2     027A
4173
UXMSG3     0289
4174
UXMSG4     029A
4175
UXSUB      02B1
4176
UXSUB1     02BD
4177
UXSUB2     02EA
4178
V1         FD06
4179
V2         FD0A
4180
V3         FD0E
4181
V4         FD12
4182
V5         FD16
4183
VFLAG      0002
4184
VOLMSG     00DD
4185
WRITSC     050A
4186
WRTLP1     051C
4187
WTDRQ      07B7
4188
WTRDY      07A8
4189
XACK       04A9
4190
XASCII     FBDA
4191
XBKPNT     F96F
4192
XBPLP      F975
4193
XBYTE0     040A
4194
XBYTE1     0419
4195
XREAD      0405
4196
XSTATE     0106
4197
XSTBL      0442
4198
XSTBLE     044D
4199
XSTCK      0483
4200
XSTCK1     0493
4201
XSTCK2     04A0
4202
XSTCOM     0458
4203
XSTDA      046C
4204
XSTDA1     047E
4205
XSTST      0422
4206
XSTST1     042C
4207
XSTST2     0438
4208
XSTST3     043F
4209
ZFLAG      0004

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.