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

Subversion Repositories System09

[/] [System09/] [trunk/] [src/] [Flex9/] [f9-monex.lst] - Blame information for rev 169

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

Line No. Rev Author Line
1 120 dilbert57
Assembler release DWC_2.0 version 2.11
2
May 6, 2004 (c) Motorola (free ware)
3
0001                         *
4
0002                         ** FLEX 9 DISK DRIVERS
5
0003                         *
6
0004                         * FOR SYS09BUG ON THE
7
0005                         * DIGILENT SPARTAN 3 STARTER BOARD AND
8
0006                         * TERASIC CYCLONE 2 DE1 BOARD
9
0007                         * WITH I/O MAPPED AT $XE000
10
0008                         * AND ROM MAPPED AT $XF000
11
0009                         * THE DIGILENT SPARTAN 3 STARTER BOARD HAS 1MBYTE OF SRAM
12
0010                         * THE TERASIC CYCLONE 2 DE1 BOARD HAS 512KBYTE OF SRAM
13
0011                         * THE FIRST 64K IS USED BY FLEX,
14
0012                         * THE SECOND 128K IS USED AS A ROM DISK
15
0013                         * THE REMAINING RAM IS USED FOR A RAM DISK
16
0014                         *
17
0015                         *
18
0016 0001                    CFLAG   EQU $01     CARRY FLAG
19
0017 0002                    VFLAG   EQU $02     OVERFLOW FLAG
20
0018 0004                    ZFLAG   EQU $04     ZERO FLAG
21
0019 0008                    NFLAG   EQU $08     NEGATIVE FLAG
22
0020 0010                    IFLAG   EQU $10     IRQ MASK CC
23
0021 0020                    HFLAG   EQU $20     HALF CARRY
24
0022 0040                    FFLAG   EQU $40     FIRQ MASK CC
25
0023 0080                    EFLAG   EQU $80     ENTIRE FLAG
26
0024                         *
27
0025 0000                    MAPPAG  EQU $00     PAGE $0000 DAT ADDRESS
28
f9-monex.txt, line no. 26: Symbol undefined Pass 2
29
0026 0000                    DATREG  EQU IC11    DAT REGISTERS
30
0027                         *
31
0028                         * Serial Port
32
0029                         *
33
f9-monex.txt, line no. 30: Symbol undefined Pass 2
34
0030 0000                    ACIAC1  EQU ACIAS
35
f9-monex.txt, line no. 31: Symbol undefined Pass 2
36
0031 0001                    ACIAD1  EQU ACIAS+1
37
0032 04E2                    DELCON  EQU 1250    Delay (Processor clock in MHz * 50)
38
0033                         *
39
0034                         * XMODEM Control characters
40
0035                         *
41
0036 0001                    SOH     EQU $01
42
0037 0004                    EOT     EQU $04
43
0038 0006                    ACK     EQU $06
44
0039 0015                    NAK     EQU $15
45
0040 0018                    CAN     EQU $18
46
0041                         *
47
0042                         * DRIVE GEOMETRY
48
0043                         *
49
0044 000E                    EMAXSEC EQU 14     ROM DISK
50
0045 0030                    EMAXTRK EQU 48     3  * 16 * 14 * 256 = 172,032 Bytes
51
0046 0292                    ETOTSEC EQU EMAXTRK*EMAXSEC-EMAXSEC
52
0047                         *
53
0048 000E                    RMAXSEC EQU 14     RAM DISK
54
0049                         *RMAXTRK EQU 192    12 * 16 * 14 * 256 = 688,128 Bytes Digilent Spartan 3
55
0050 0040                    RMAXTRK EQU 64    4 * 16 * 14 * 256 = 229,376 Bytes Terasic Cyclone 2
56
0051 0372                    RTOTSEC EQU RMAXTRK*RMAXSEC-RMAXSEC
57
0052                         *
58
0053                         * DRIVE TYPES
59
0054                         *
60
0055 0000                    DTYPROM EQU 0      ROM DISK
61
0056 0001                    DTYPRAM EQU 1      RAM DISK
62
0057 0002                    DTYPFLS EQU 2      FLASH DISK
63
0058 0003                    DTYPNET EQU 3      FLEXNET DISK
64
0059                         *
65
0060 DE00                           ORG   $DE00
66
0061                         *
67
0062                         * DISK DRIVER JUMP TABLE LAST UPDATE: 22/12/2006
68
0063                         * Disk driver for RAM Disk.
69
0064                         *
70
0065                         * 14 SECTORS PER TRACK
71
0066                         * 16 * N TRACKS PER DISK
72
0067                         *
73
0068                         * ROM DISK OCCUPIES $10000 - $1E000 ... $30000 - $3E000
74
0069                         * RAM DISK OCCUPIES $40000 - $4E000 ... $F0000 - $FE000
75
0070                         * Track Buffer page mapped at $E000 - $EFFF
76
0071                         * MAPPAG = $00 = 0 x $1000 (4 K pages)
77
0072
78
0073                         * ON SWTPC ROM AT $XF000 AND IO AT $XE000
79
0074                         * APPEARS THROUGHOUT THE MEMORY SO MUST BE SKIPPED OVER
80
0075                         * WHEN USING RAM AS A RAMDISK.
81
0076                         * THE MSN OF THE TRACK MAPS INTO THE MSN OF THE DAT
82
0077                         * THE LSN OF THE TRACK NUMBER INDEXES INTO THE 4K RAM PAGE
83
0078                         * THE SECTOR MAPS INTO THE LSN OF THE DAT WHICH IS INVERTED
84
0079                         *
85
0080                         *
86
0081                         *
87
0082                         * FLEX disk jump table.
88
0083                         *
89
0084 DE00 0E 57              READ   JMP   READSC
90
f9-monex.txt, line no. 85: Phasing Error
91
0085 DE02 0E 5B              WRITE  JMP   WRITSC
92
f9-monex.txt, line no. 86: Phasing Error
93
0086 DE04 0E 5F              VERIFY JMP   BUSY
94
f9-monex.txt, line no. 87: Phasing Error
95
0087 DE06 0E 63              RESTOR JMP   RESTR1
96
f9-monex.txt, line no. 88: Phasing Error
97
0088 DE08 0E 6C              DRIVE  JMP   DRVSEL
98
f9-monex.txt, line no. 89: Phasing Error
99
0089 DE0A 0E 9F              DRVRDY JMP   CHKRDY
100
f9-monex.txt, line no. 90: Phasing Error
101
0090 DE0C 0E A3              QUICK  JMP   CHKQIK
102
f9-monex.txt, line no. 91: Phasing Error
103
0091 DE0E 0E A7              COLDDR JMP   DINIT
104
f9-monex.txt, line no. 92: Phasing Error
105
0092 DE10 0E BF              WARMDR JMP   DWARM
106
f9-monex.txt, line no. 93: Phasing Error
107
0093 DE12 0E C3              SEEK   JMP   SEEKTS
108
0094                         *
109
0095                         * RAM SPACE
110
0096                         *
111
f9-monex.txt, line no. 97: Phasing Error
112
0097 DE14 00                 DRVNUM  FCB  0
113
f9-monex.txt, line no. 98: Phasing Error
114
0098 DE15 00                 TRACK   FCB  0
115
f9-monex.txt, line no. 99: Phasing Error
116
0099 DE16 00                 SECTOR  FCB  0
117
f9-monex.txt, line no. 100: Phasing Error
118
0100 DE17 00                 CHKSUM  FCB  0
119
f9-monex.txt, line no. 101: Phasing Error
120
0101 DE18 00                 CCSAVE  FCB  0
121
f9-monex.txt, line no. 102: Phasing Error
122
0102 DE19 00                 BLKNUM  FCB  0 Xmodem block number
123
f9-monex.txt, line no. 103: Phasing Error
124
0103 DE1A 00                 BYTCNT  FCB  0 Xmodem byte count
125
f9-monex.txt, line no. 104: Phasing Error
126
0104 DE1B 00 00              XSTATE  FDB  0 Xmodem State Vector
127
f9-monex.txt, line no. 105: Phasing Error
128
0105 DE1D 00 00 00           DELCNT  FCB  $00,$00,$00 Xmodem Poll timer
129
0106                         *
130
0107                         * Disc driver type table.
131
0108                         * Indexed by drive number
132
0109                         *
133
f9-monex.txt, line no. 110: Phasing Error
134
0110 DE20 00                 DTYPTAB FCB  DTYPROM Drive 0 (ROM Disk)
135
0111 DE21 01                         FCB  DTYPRAM Drive 1 (RAM Disk)
136
0112 DE22 02                         FCB  DTYPFLS Drive 2 (FLASH Disk)
137
0113 DE23 03                         FCB  DTYPNET Drive 3 (NETPC Disk)
138
0114                         *
139
0115                         * RAM Disk offset
140
0116                         * Indexed by drive type
141
0117                         *
142
f9-monex.txt, line no. 118: Phasing Error
143
0118 DE24 10                 DOFFTAB FCB  $10 ROM Disk $10000
144
0119 DE25 40                         FCB  $40 RAM DISK $40000
145
0120 DE26 FF                         FCB  $FF Flash Disk
146
0121 DE27 FF                         FCB  $FF NETPC Disk
147
0122                         *
148
f9-monex.txt, line no. 123: Phasing Error
149
0123 DE28                    REAVEC  RMB  2             Disc driver jump table.
150
f9-monex.txt, line no. 124: Phasing Error
151
0124 DE2A                    WRIVEC  RMB  2
152
f9-monex.txt, line no. 125: Phasing Error
153
0125 DE2C                    VERVEC  RMB  2
154
f9-monex.txt, line no. 126: Phasing Error
155
0126 DE2E                    RSTVEC  RMB  2
156
f9-monex.txt, line no. 127: Phasing Error
157
0127 DE30                    DRVVEC  RMB  2
158
f9-monex.txt, line no. 128: Phasing Error
159
0128 DE32                    CHKVEC  RMB  2
160
f9-monex.txt, line no. 129: Phasing Error
161
0129 DE34                    QUIVEC  RMB  2
162
f9-monex.txt, line no. 130: Phasing Error
163
0130 DE36                    INIVEC  RMB  2
164
f9-monex.txt, line no. 131: Phasing Error
165
0131 DE38                    WARVEC  RMB  2
166
f9-monex.txt, line no. 132: Phasing Error
167
0132 DE3A                    SEEVEC  RMB  2
168
0133                         *
169
0134                         * SECTOR BUFFER
170
0135                         *
171
f9-monex.txt, line no. 136: Phasing Error
172
0136 DE3C                    BUFFER  RMB  256
173
f9-monex.txt, line no. 137: Phasing Error
174
0137 DF3C                    SYNCREG RMB  4      Prom input register
175
0138                         *
176
0139                         ****************************************
177
0140                         *
178
0141                         * START OF EXTENSION COMMANDS
179
0142                         *
180
0143                         ****************************************
181
0144                         *
182
f9-monex.txt, line no. 145: Symbol undefined Pass 2
183
0145 0000                            ORG MONEXT
184
0146 0000 07 9C                      FDB NEXTEXT   Jump to next extended command
185
0147                         *
186
0148                         *
187
0149                         *****************************************
188
0150                         * Disk drivers                          *
189
0151                         * ------------                          *
190
0152                         * The system dependant code for the     *
191
0153                         * disc drivers fits here. Two tables    *
192
0154                         * must be included. These are DTYPTAB a  *
193
0155                         * four byte table that defines which of *
194
0156                         * the (up to four) following sets of    *
195
0157                         * jump tables to use, and TABSRT the    *
196
0158                         * jump tables themselves. For a full    *
197
0159                         * description of the floppy drivers see *
198
0160                         * section 4 (pp9-14) of the general     *
199
0161                         * Flex adaptation guide.                *
200
0162                         *****************************************
201
0163                         *
202
0164                         * Mass storage drivers for embedded applications.
203
0165                         *
204
0166                         * Jump tables.
205
0167 0002 01 17              TABSRT  FDB EREAD Drive type 0 (ROM disk).
206
0168 0004 01 3F                      FDB EWRITE
207
0169 0006 01 3D                      FDB ECHECK
208
0170 0008 01 3D                      FDB ECHECK
209
0171 000A 01 3D                      FDB ECHECK
210
0172 000C 01 3D                      FDB ECHECK
211
0173 000E 01 3D                      FDB ECHECK
212
0174 0010 00 52                      FDB DDUMMY
213
0175 0012 00 52                      FDB DDUMMY
214
0176 0014 00 52                      FDB DDUMMY
215
0177                         *
216
0178 0016 01 17                      FDB EREAD Drive type 1 (RAM disk).
217
0179 0018 01 3F                      FDB EWRITE
218
0180 001A 01 3D                      FDB ECHECK
219
0181 001C 01 3D                      FDB ECHECK
220
0182 001E 01 3D                      FDB ECHECK
221
0183 0020 01 3D                      FDB ECHECK
222
0184 0022 01 3D                      FDB ECHECK
223
0185 0024 00 52                      FDB DDUMMY
224
0186 0026 00 52                      FDB DDUMMY
225
0187 0028 00 52                      FDB DDUMMY
226
0188                         *
227
0189 002A 00 52                      FDB DDUMMY Drive type 2 (External Flash disk).
228
0190 002C 00 52                      FDB DDUMMY
229
0191 002E 00 52                      FDB DDUMMY
230
0192 0030 00 52                      FDB DDUMMY
231
0193 0032 00 52                      FDB DDUMMY
232
0194 0034 00 52                      FDB DDUMMY
233
0195 0036 00 52                      FDB DDUMMY
234
0196 0038 00 52                      FDB DDUMMY
235
0197 003A 00 52                      FDB DDUMMY
236
0198 003C 00 52                      FDB DDUMMY
237
0199                         *
238
0200 003E 01 78                      FDB NREAD  Drive type 3 (NetPC drive via serial port).
239
0201 0040 01 E7                      FDB NWRITE
240
0202 0042 02 47                      FDB NVERIFY
241
0203 0044 02 4C                      FDB NCHECK
242
0204 0046 02 4C                      FDB NCHECK
243
0205 0048 02 4C                      FDB NCHECK
244
0206 004A 02 4C                      FDB NCHECK
245
0207 004C 00 52                      FDB DDUMMY
246
0208 004E 00 52                      FDB DDUMMY
247
0209 0050 00 52                      FDB DDUMMY
248
0210                         *
249
0211                         *
250
0212                         * Dummy routine (no errors).
251
0213 0052 5F                 DDUMMY  CLRB
252
0214 0053 5D                         TSTB  Set (z)=1
253
0215 0054 1C FE                      ANDCC  #$FF-CFLAG  Set (c)=0
254
0216 0056 39                         RTS
255
0217                         *               *
256
0218                         **************************
257
0219                         * Main Flex entry points *
258
0220                         *************************
259
0221                         *
260
0222                         * Read sector routine.
261
0223                         * Entry: (X) = address where sector is to be placed.
262
0224                         *        (A) = Track  number.
263
0225                         *        (B) = Sector number.
264
0226                         * Exit:  (B) = Error code  (z)=1 if no error.
265
0227 0057 6E 9F DE 32        READSC  JMP  [REAVEC]
266
0228                         *
267
0229                         * Write track routine.
268
0230                         * Entry: (X) = Address of area of memory from which the data will be taken.
269
0231                         *        (A) = Track number.
270
0232                         *        (B) = Sector number.
271
0233                         * Exit:  (B) = Error condition, (Z)=1 no an error.
272
0234 005B 6E 9F DE 34        WRITSC  JMP  [WRIVEC]
273
0235                         *
274
0236                         * Verify sector routine.
275
0237                         * Entry: no parameters.
276
0238                         * Exit:  (B) = Error condition (Z)=1 if no error.
277
0239 005F 6E 9F DE 36        BUSY  JMP  [VERVEC]
278
0240                         *
279
0241                         * Restore drive to track 00.
280
0242                         * Entry: (X) = FCB address (3,X contains drive number).
281
0243                         * Exit:  (B) = Error condition, (Z)=1 if no error.
282
0244 0063 8D 07              RESTR1  BSR  DRVSEL Select drive first.
283
0245 0065 27 01                      BEQ  RST1
284
0246 0067 39                         RTS
285
0247 0068 6E 9F DE 38        RST1    JMP  [RSTVEC]
286
0248                         *
287
0249                         * Select current drive.
288
0250                         * Entry: (X) = FCB address (3,X contains drive number).
289
0251                         * Exit:  (B) = Error condition, (Z)=0 and (c)=1 if error.
290
0252                         *        (B) = $0F if non existant drive.
291
0253 006C 34 30              DRVSEL  PSHS  X,Y
292
0254 006E E6 03                      LDB  3,X  Get driver type.
293
0255 0070 F7 DE 1E                   STB  DRVNUM
294
0256 0073 8E DE 2A                   LDX  #DTYPTAB
295
0257 0076 A6 85                      LDA  B,X
296
0258 0078 81 FF                      CMPA  #$FF  Is the drive nonexistant?
297
0259 007A 26 08                      BNE  DRIVE1
298
0260 007C 35 30                      PULS  X,Y
299
0261 007E C6 0F                      LDB  #$0F
300
0262 0080 5D                         TSTB
301
0263 0081 1A 01                      ORCC  #$01
302
0264 0083 39                         RTS
303
0265                         *
304
0266 0084 C6 14              DRIVE1  LDB  #20  Get correct table start address.
305
0267 0086 3D                         MUL
306
0268 0087 8E 00 02                   LDX  #TABSRT
307
0269 008A 30 8B                      LEAX  D,X
308
0270 008C 10 8E DE 32                LDY  #REAVEC Copy table into ram.
309
0271 0090 C6 14                      LDB  #20
310
0272 0092 A6 80              DRIVE2  LDA  0,X+
311
0273 0094 A7 A0                      STA  0,Y+
312
0274 0096 5A                         DECB
313
0275 0097 26 F9                      BNE  DRIVE2
314
0276 0099 35 30                      PULS X,Y
315
0277 009B 6E 9F DE 3A                JMP  [DRVVEC]
316
0278                         *
317
0279                         * Check for drive ready.
318
0280                         * Entry: (X) = FCB address (3,X contains drive number)>
319
0281                         * Exit:  (B) = Error condition, (Z)=0 AND (C)=1 if drive is not ready.
320
0282 009F 6E 9F DE 3C        CHKRDY  JMP  [CHKVEC]
321
0283                         *
322
0284                         * Quick drive ready check.
323
0285                         * Entry: (X) = FCB address (3,X contains drive number).
324
0286                         * Exit:  (B) = Error condition, (Z)=0 AND (c)=1 if drive not ready.
325
0287 00A3 6E 9F DE 3E        CHKQIK  JMP  [QUIVEC]
326
0288                         *
327
0289                         * Init (cold start).
328
0290                         * Entry: no parameters.
329
0291                         * Exit: no change.
330
0292 00A7 4F                 DINIT   CLRA
331
0293 00A8 B7 DE 1E           DINIT1  STA  DRVNUM  Init each valid drive in turn.
332
0294 00AB 8E DE 1B                   LDX  #DRVNUM-3
333
0295 00AE 8D BC                      BSR  DRVSEL
334
0296 00B0 25 04                      BCS  DINIT2
335
0297 00B2 AD 9F DE 40                JSR  [INIVEC]
336
0298 00B6 B6 DE 1E           DINIT2  LDA  DRVNUM
337
0299 00B9 4C                         INCA
338
0300 00BA 81 04                      CMPA  #4
339
0301 00BC 26 EA                      BNE  DINIT1
340
0302 00BE 39                         RTS
341
0303                         *
342
0304                         * Warm start.
343
0305                         * Entry: no parameters.
344
0306                         * Exit: no change.
345
0307 00BF 6E 9F DE 42        DWARM    JMP  [WARVEC]
346
0308                         *
347
0309                         * Seek track.
348
0310                         * Entry: (A) = Track number.
349
0311                         *        (B) = Sector number.
350
0312                         * Exit:  (B) = Error condition, (Z)=1 if no error.
351
0313 00C3 6E 9F DE 44        SEEKTS  JMP  [SEEVEC]
352
0314                         *
353
0315                         *
354
0316                         *****************************************************
355
0317                         * ROMdisk drivers                                   *
356
0318                         * ---------------                                   *
357
0319                         * Drivers to support a ROMdisk in the external RAM  *
358
0320                         * of the SYS09. The ROMdisk base address is $10000   *
359
0321                         *****************************************************
360
0322                         * Dummy return for ROM disk (write protected!)
361
0323                         *
362
0324                         * MAP RAM DISK INTO MEMORY SPACE
363
0325                         *
364
0326 00C7 1F A8              MAPIN   TFR   CC,A     ; Save state of interrupt masks
365
0327 00C9 B7 DE 22                   STA   CCSAVE
366
0328 00CC 1A 50                      ORCC  #FFLAG+IFLAG ; Mask interrupts while IO mapped out
367
0329 00CE CE DE 2A                   LDU   #DTYPTAB  ; Point to Drive Type table
368
0330 00D1 F6 DE 1E                   LDB   DRVNUM   ; Get working drive number
369
0331 00D4 E6 C5                      LDB   B,U
370
0332 00D6 CE DE 2E                   LDU   #DOFFTAB
371
0333 00D9 B6 DE 1F                   LDA   TRACK
372
0334 00DC AB C5                      ADDA  B,U      ; Add Base offset into RAM
373
0335 00DE 84 F0                      ANDA  #$F0     ; Mask MSN
374
0336 00E0 A7 E2                      STA   ,-S      ; Save A on stack
375
0337                         *
376
0338 00E2 B6 DE 20                   LDA   SECTOR
377
0339 00E5 80 01                      SUBA  #1       ; Sectors 1 to 14 => 0 to 13
378
0340 00E7 88 0F                      EORA  #$0F     ; Complement LSNybble
379
0341 00E9 84 0F                      ANDA  #$0F
380
0342                         *
381
0343 00EB AB E0                      ADDA  ,S+       ; Add sector to LSN of Track and pop
382
0344 00ED 97 00                      STA   DATREG+MAPPAG
383
0345                         *
384
0346 00EF B6 DE 1F                   LDA   TRACK   ; LSN of Track indexes into 4K page
385
0347 00F2 84 0F                      ANDA  #$0F
386
0348 00F4 8B 00                      ADDA  #MAPPAG*16
387
0349 00F6 5F                         CLRB
388
0350 00F7 1F 03                      TFR   D,U
389
0351 00F9 39                         RTS
390
0352                         *
391
0353                         * MAP RAM DISK OUT OF MEMORY
392
0354                         *
393
0355 00FA 86 00              MAPOUT  LDA   #MAPPAG  ; Point to the Flex page
394
0356 00FC 88 0F                      EORA  #$0F     ; Complement LSNybble
395
0357 00FE 97 00                      STA   DATREG+MAPPAG ; map in Flex page
396
0358 0100 B6 DE 22                   LDA   CCSAVE   ; restore interrupt masks
397
0359 0103 1F 8A                      TFR   A,CC
398
0360 0105 39                         RTS
399
0361                         *
400
0362                         * Seek track and sector
401
0363                         * A holds track number (0-32)
402
0364                         * B holds sector number (1-14)
403
0365                         *
404
0366 0106 B7 DE 1F           ESEEK   STA   TRACK
405
0367 0109 F7 DE 20                   STB   SECTOR
406
0368 010C 1C FE                      ANDCC #$FE   ; CLEAR CARRY
407
0369 010E 1A 04                      ORCC  #$04   ; SET Z
408
0370 0110 39                         RTS
409
0371                         *
410
0372                         * MARK DISK READ ONLY
411
0373                         *
412
0374 0111 C6 40              EDUMMY  LDB  #$40
413
0375 0113 5D                         TSTB
414
0376 0114 1A 01                      ORCC  #$01
415
0377 0116 39                         RTS
416
0378                         *
417
0379 0117 34 70              EREAD   PSHS X,Y,U push sequentialy to preserve order on stack
418
0380 0119 17 FF EA                   LBSR ESEEK
419
0381 011C 17 FF A8                   LBSR MAPIN build external ram address
420
0382                         *
421
0383 011F 10 8E DE 46                LDY #BUFFER
422
0384 0123 5F                         CLRB
423
0385 0124 A6 C0              ERLOOP1 LDA 0,U+ move 256 bytes to buffer from external RAM
424
0386 0126 A7 A0                      STA 0,Y+
425
0387 0128 5A                         DECB
426
0388 0129 26 F9                      BNE ERLOOP1
427
0389                         *
428
0390 012B 17 FF CC                   LBSR MAPOUT
429
0391                         *
430
0392 012E 10 8E DE 46                LDY #BUFFER
431
0393 0132 5F                         CLRB
432
0394 0133 A6 A0              ERLOOP2 LDA 0,Y+ move 256 bytes from buffer to Flex RAM
433
0395 0135 A7 80                      STA 0,X+
434
0396 0137 5A                         DECB
435
0397 0138 26 F9                      BNE ERLOOP2
436
0398                         *
437
0399 013A 5F                         CLRB
438
0400 013B 35 F0                      PULS X,Y,U,PC  restore all registers
439
0401                         *
440
0402                         * check for marker bytes $AA55 in first bytes of first track/sector
441
0403                         *
442
0404                         *ECHECK  CLRA
443
0405                         *        LDB  #1
444
0406                         *        LDX  #BUFFER
445
0407                         *        BSR  EREAD
446
0408                         *        LDD  BUFFER
447
0409                         *        CMPD  #$AA55
448
0410                         *        BNE  EERR
449
0411                         *        LBRA  DDUMMY
450
0412                         *EERR    LDB  #$80 not ready bit set
451
0413                         *        TSTB
452
0414                         *        ORCC  #$01
453
0415                         *        RTS
454
0416 013D 5F                 ECHECK CLRB
455
0417 013E 39                        RTS
456
0418                         *
457
0419                         * Write Sector
458
0420                         *
459
0421 013F 34 70              EWRITE  PSHS X,Y,U
460
0422 0141 17 FF C2                   LBSR ESEEK
461
0423 0144 CE DE 2A                   LDU  #DTYPTAB  ; Point to Drive Type table
462
0424 0147 F6 DE 1E                   LDB  DRVNUM    ; Get working drive number
463
0425 014A E6 C5                      LDB  B,U       ; Fetch Drive type
464
0426 014C C1 01                      CMPB #DTYPRAM  ; Is it a RAM Disk ?
465
0427 014E 27 07                      BEQ  EWOK      ; Yep, can write to it
466
0428 0150 C1 00                      CMPB #DTYPROM  ; Allow writes to ROM Disk too
467
0429 0152 27 03                      BEQ  EWOK
468
0430 0154 16 FF BA                   LBRA EDUMMY    ; Nope report read only
469
0431                         *
470
0432 0157 10 8E DE 46        EWOK    LDY #BUFFER
471
0433 015B 5F                         CLRB
472
0434 015C A6 80              EWLOOP1 LDA 0,X+ move 256 bytes to buffer from Flex RAM
473
0435 015E A7 A0                      STA 0,Y+
474
0436 0160 5A                         DECB
475
0437 0161 26 F9                      BNE EWLOOP1
476
0438                         *
477
0439 0163 17 FF 61                   LBSR MAPIN
478
0440                         *
479
0441 0166 10 8E DE 46                LDY #BUFFER
480
0442 016A 5F                         CLRB
481
0443 016B A6 A0              EWLOOP2 LDA 0,Y+ move 256 bytes from buffer to external RAM
482
0444 016D A7 C0                      STA 0,U+
483
0445 016F 5A                         DECB
484
0446 0170 26 F9                      BNE EWLOOP2
485
0447                         *
486
0448 0172 17 FF 85                   LBSR MAPOUT
487
0449                         *
488
0450 0175 5F                    CLRB
489
0451 0176 35 F0                      PULS X,Y,U,PC
490
0452                         *
491
0453                         *
492
0454                         *****************************************************
493
0455                         * FlexNet drivers                                   *
494
0456                         * ---------------                                   *
495
0457                         * Drivers to support a remote connection via the    *
496
0458                         * serial port using the FlexNet protocol as defined *
497
0459                         * in FLEXNet_421B                                   *
498
0460                         *****************************************************
499
0461                         *
500
0462                         *
501
0463                         * read sector from remote drive
502
0464                         *
503
0465 0178 34 04              NREAD   PSHS    B
504
0466 017A 34 02                      PSHS    A
505
0467 017C 7F DE 21                   CLR     CHKSUM          clear checksum
506
0468 017F 7F DE 22                   CLR     CHKSUM+1
507
0469                         *
508
0470 0182 86 73                      LDA     #'s             Send read sector command
509
0471 0184 BD 02 81                   JSR     SCHAR
510
0472 0187 24 4C                      BCC     NRD_DNR         if timeout, then flag drive not ready
511
0473                         *
512
0474 0189 B6 DE 1E                   LDA     DRVNUM           send drive
513
0475 018C BD 02 81                   JSR     SCHAR
514
0476 018F 24 44                      BCC     NRD_DNR
515
0477                         *
516
0478 0191 35 02                      PULS    A               send track
517
0479 0193 BD 02 81                   JSR     SCHAR
518
0480 0196 24 3D                      BCC     NRD_DNR
519
0481                         *
520
0482 0198 35 02                      PULS    A               send sector
521
0483 019A BD 02 81                   JSR     SCHAR
522
0484 019D 24 36                      BCC     NRD_DNR
523
0485                         *
524
0486                         * transfer 256 bytes
525
0487 019F 5F                         CLRB
526
0488 01A0 BD 02 65           NREAD1  JSR     RCHAR           read byte
527
0489 01A3 24 30                      BCC     NRD_DNR         if timeout, then flag drive not ready
528
0490 01A5 A7 80                      STA     0,X+
529
0491 01A7 BB DE 22                   ADDA    CHKSUM+1        update checksum
530
0492 01AA B7 DE 22                   STA     CHKSUM+1
531
0493 01AD 24 03                      BCC     NREAD2
532
0494 01AF 7C DE 21                   INC     CHKSUM
533
0495 01B2 5A                 NREAD2  DECB
534
0496 01B3 26 EB                      BNE     NREAD1
535
0497                         *
536
0498                         * compare checksums
537
0499 01B5 BD 02 65                   JSR     RCHAR           get checksum msb
538
0500 01B8 24 1B                      BCC     NRD_DNR
539
0501 01BA 34 02                      PSHS    A
540
0502 01BC BD 02 65                   JSR     RCHAR           get checksum lsb
541
0503 01BF 24 14                      BCC     NRD_DNR
542
0504 01C1 1F 89                      TFR     A,B
543
0505 01C3 35 02                      PULS    A
544
0506 01C5 10 B3 DE 21                CMPD    CHKSUM          compare checksums
545
0507 01C9 26 0E                      BNE     NRD_ERR         if checksum error, then flag crc read error
546
0508                         *
547
0509 01CB 86 06                      LDA     #ACK            no checksum error, send ACK char
548
0510 01CD BD 02 81                   JSR     SCHAR
549
0511 01D0 24 03                      BCC     NRD_DNR
550
0512 01D2 5F                         CLRB                    all OK, flag no error
551
0513 01D3 20 0D                      BRA     NRD_END
552
0514                         *
553
0515 01D5 C6 10              NRD_DNR LDB     #16             flag drive not ready
554
0516 01D7 20 09                      BRA     NRD_END
555
0517                         *
556
0518 01D9 86 15              NRD_ERR LDA     #NAK            send NAK
557
0519 01DB BD 02 81                   JSR     SCHAR
558
0520 01DE 24 F5                      BCC     NRD_DNR
559
0521 01E0 C6 09                      LDB     #09             flag crc read error
560
0522                         *
561
0523 01E2 F7 DE 21           NRD_END STB     CHKSUM          used by VERIFY
562
0524 01E5 5D                         TSTB
563
0525 01E6 39                         RTS
564
0526                         *
565
0527                         *
566
0528                         * write sector to remote drive
567
0529                         *
568
0530 01E7 34 04              NWRITE  PSHS B
569
0531 01E9 34 02                      PSHS A
570
0532 01EB 7F DE 21                   CLR     CHKSUM          clear checksum
571
0533 01EE 7F DE 22                   CLR     CHKSUM+1
572
0534                         *
573
0535 01F1 86 72                      LDA     #'r             Send write sector command
574
0536 01F3 BD 02 81                   JSR     SCHAR
575
0537 01F6 24 DD                      BCC     NRD_DNR         if timeout, then flag drive not ready
576
0538                         *
577
0539 01F8 B6 DE 1E                   LDA     DRVNUM           send drive
578
0540 01FB BD 02 81                   JSR     SCHAR
579
0541 01FE 24 D5                      BCC     NRD_DNR
580
0542                         *
581
0543 0200 35 02                      PULS    A               send track
582
0544 0202 BD 02 81                   JSR     SCHAR
583
0545 0205 24 CE                      BCC     NRD_DNR
584
0546                         *
585
0547 0207 35 02                      PULS    A               send sector
586
0548 0209 BD 02 81                   JSR     SCHAR
587
0549 020C 24 C7                      BCC     NRD_DNR
588
0550                         *
589
0551                         * transfer 256 bytes
590
0552 020E 5F                         CLRB
591
0553 020F A6 80              NWRITE1 LDA     0,X+
592
0554 0211 BD 02 81                   JSR     SCHAR           write byte
593
0555 0214 24 BF                      BCC     NRD_DNR         if timeout, then flag drive not ready
594
0556 0216 BB DE 22                   ADDA    CHKSUM+1        update checksum
595
0557 0219 B7 DE 22                   STA     CHKSUM+1
596
0558 021C 24 03                      BCC     NWRITE2
597
0559 021E 7C DE 21                   INC     CHKSUM
598
0560 0221 5A                 NWRITE2 DECB
599
0561 0222 26 EB                      BNE     NWRITE1
600
0562                         *
601
0563                         * compare checksums
602
0564 0224 B6 DE 21                   LDA     CHKSUM
603
0565 0227 BD 02 81                   JSR     SCHAR           send checksum msb
604
0566 022A 24 A9                      BCC     NRD_DNR
605
0567 022C B6 DE 22                   LDA     CHKSUM+1
606
0568 022F BD 02 81                   JSR     SCHAR           send checksum lsb
607
0569 0232 24 A1                      BCC     NRD_DNR
608
0570                         *
609
0571 0234 BD 02 65                   JSR     RCHAR           get checksum response
610
0572 0237 24 9C                      BCC     NRD_DNR
611
0573 0239 81 06                      CMPA    #ACK
612
0574 023B 26 03                      BNE     NWR_ERR         if checksum error, then flag write error
613
0575                         *
614
0576 023D 5F                         CLRB                    all OK, flag no error
615
0577 023E 20 02                      BRA     NWR_END
616
0578                         *
617
0579 0240 C6 0A              NWR_ERR LDB     #10             flag write error
618
0580                         *
619
0581 0242 F7 DE 21           NWR_END STB     CHKSUM          used by VERIFY
620
0582 0245 5D                         TSTB
621
0583 0246 39                         RTS
622
0584                         *
623
0585                         *
624
0586                         *   verify last sector written to remote drive
625
0587                         *
626
0588 0247 F6 DE 21           NVERIFY LDB     CHKSUM         test last checksum
627
0589 024A 5D                         TSTB
628
0590 024B 39                         RTS
629
0591                         *
630
0592                         *
631
0593                         *   quck check and check drive ready
632
0594                         *
633
0595 024C 86 51              NCHECK  LDA     #'Q             quick check command
634
0596 024E BD 02 81                   JSR     SCHAR
635
0597 0251 24 0C                      BCC     NCK_ERR         if timeout, then flag drive not ready
636
0598
637
0599 0253 BD 02 65                   JSR     RCHAR           get response from host
638
0600 0256 24 07                      BCC     NCK_ERR
639
0601 0258 81 06                      CMPA    #ACK
640
0602 025A 26 03                      BNE     NCK_ERR         if NAK, then flag drive not ready
641
0603
642
0604 025C 5F                         CLRB                    all OK, flag drive ready
643
0605 025D 20 04                      BRA     NCK_END
644
0606                         *
645
0607 025F C6 10              NCK_ERR LDB     #16             report drive not ready
646
0608 0261 1A 01                      ORCC    #$01            check needs carry set as well
647
0609                         *
648
0610 0263 5D                 NCK_END TSTB
649
0611 0264 39                         RTS
650
0612                         *
651
0613                         *
652
0614                         * recieve char from remote drive.
653
0615                         * timeout if no response for approx 1s.
654
0616                         * Entry: no parameters
655
0617                         * Exit:  (A) = recieved char, (C)=1 if valid char, (C)=0 if timeout.
656
0618                         *
657
0619 0265 34 30              RCHAR   PSHS    X,Y
658
0620                         *
659
0621 0267 8E 03 E8                   LDX     #1000         1000x inner loop
660
0622 026A 10 8E 04 E2        RCHAR1  LDY     #DELCON       delay constant for inner loop (approx 1ms).
661
0623 026E 96 00              RCHAR2  LDA     ACIAC1        test for recieved char
662
0624 0270 47                         ASRA
663
0625 0271 25 0A                      BCS     RCHAR3        get character
664
0626 0273 31 3F                      LEAY    -1,Y          else, continue to count delay
665
0627 0275 26 F7                      BNE     RCHAR2
666
0628 0277 30 1F                      LEAX    -1,X
667
0629 0279 26 EF                      BNE     RCHAR1
668
0630 027B 35 B0                      PULS    X,Y,PC        return with error if timed out
669
0631                         *
670
0632 027D 96 01              RCHAR3  LDA     ACIAD1        return data (carry bit still set)
671
0633 027F 35 B0                      PULS    X,Y,PC
672
0634                         *
673
0635                         *
674
0636                         * transmit char to remote drive.
675
0637                         * timeout if no response for approx 1s. (allows for use of hardware flow control)
676
0638                         * Entry: (A) = char to transmit
677
0639                         * Exit:  (A) = recieved char, (C)=1 if valid char, (C)=0 if timeout.
678
0640                         *
679
0641 0281 34 30              SCHAR   PSHS    X,Y
680
0642 0283 34 02                      PSHS    A
681
0643                         *
682
0644 0285 8E 03 E8                   LDX     #1000         1000x inner loop
683
0645 0288 10 8E 04 E2        SCHAR1  LDY     #DELCON       delay constant for inner loop (approx 1ms).
684
0646 028C 96 00              SCHAR2  LDA     ACIAC1        test for space in transmit FIFO
685
0647 028E 47                         ASRA
686
0648 028F 47                         ASRA
687
0649 0290 25 0C                      BCS     SCHAR3        send character
688
0650 0292 31 3F                      LEAY    -1,Y          else, continue to count delay
689
0651 0294 26 F6                      BNE     SCHAR2
690
0652 0296 30 1F                      LEAX    -1,X
691
0653 0298 26 EE                      BNE     SCHAR1
692
0654 029A 35 02                      PULS    A
693
0655 029C 35 B0                      PULS    X,Y,PC        return with error if timed out
694
0656                         *
695
0657 029E 35 02              SCHAR3  PULS    A
696
0658 02A0 97 01                      STA     ACIAD1        send data (carry bit still set)
697
0659 02A2 35 B0                      PULS    X,Y,PC
698
0660                         *
699
0661                         ** 'UF' Format RAMdisc to FLEX standard.
700
0662                         *
701
0663 02A4 0A 0D              DISFOS  FCB $0A,$0D
702
0664 02A6 46 6F 72 6D 61 74          FCC 'Formating RAMdisk... '
703
          69 6E 67 20 52 41
704
          4D 64 69 73 6B 2E
705
          2E 2E 20
706
0665 02BB 04                         FCB 4
707
0666 02BC 0A 0D 04           MESS6   FCB $0A,$0D,4
708
0667 02BF 52 61 6D 64 69 73          FCC 'Ramdisk not allocated! '
709
          6B 20 6E 6F 74 20
710
          61 6C 6C 6F 63 61
711
          74 65 64 21 20
712
0668 02D6 04                    FCB 4
713
0669                         *
714
0670 02D7 8E 02 A4           UFSUB   LDX #DISFOS
715
0671 02DA BD 04 50                   JSR PDATA1
716
0672 02DD 8E DE 2A                   LDX #DTYPTAB               search for allocated ramdisk
717
0673 02E0 5F                         CLRB
718
0674 02E1 A6 85              FMT9    LDA B,X
719
0675 02E3 81 01                      CMPA #DTYPRAM              driver type 1 is ramdisk
720
0676 02E5 27 0C                      BEQ FFOUND
721
0677 02E7 5C                         INCB
722
0678 02E8 C1 04                      CMPB #4            end of table? then not allocated.
723
0679 02EA 26 F5                      BNE FMT9
724
0680 02EC 8E 02 BC                   LDX #MESS6
725
0681 02EF BD 04 50                   JSR PDATA1
726
0682 02F2 39                         RTS
727
0683                         *
728
0684 02F3 F7 DE 1E           FFOUND  STB DRVNUM
729
0685 02F6 8E DE 1B                   LDX #DRVNUM-3
730
0686 02F9 9D 6C                      JSR DRVSEL
731
0687                         *
732
0688                         * set up free chain
733
0689                         *
734
0690 02FB 8E DE 46                   LDX #BUFFER clear out buffer
735
0691 02FE 4F                         CLRA
736
0692 02FF 5F                         CLRB
737
0693 0300 A7 80              DFL1    STA 0,X+
738
0694 0302 5A                         DECB
739
0695 0303 26 FB                      BNE DFL1
740
0696                         *
741
0697 0305 7F DE 1F                   CLR TRACK
742
0698 0308 86 01                      LDA #1
743
0699 030A B7 DE 20                   STA SECTOR
744
0700 030D 8E DE 46           DFL2    LDX #BUFFER
745
0701 0310 B6 DE 1F                   LDA TRACK
746
0702 0313 A7 84                      STA 0,X
747
0703 0315 B6 DE 20                   LDA SECTOR
748
0704 0318 4C                         INCA
749
0705 0319 81 0F                      CMPA #RMAXSEC+1 last sector on track?
750
0706 031B 26 04                      BNE DFL3
751
0707 031D 6C 84                      INC 0,X
752
0708 031F 86 01                      LDA #1
753
0709 0321 A7 01              DFL3    STA 1,X
754
0710 0323 B6 DE 1F                   LDA TRACK
755
0711 0326 F6 DE 20                   LDB SECTOR
756
0712 0329 9D 5B                      JSR WRITSC
757
0713 032B 7C DE 20                   INC SECTOR
758
0714 032E B6 DE 20                   LDA SECTOR
759
0715 0331 81 0F                      CMPA #RMAXSEC+1
760
0716 0333 26 D8                      BNE DFL2
761
0717 0335 86 01                      LDA #1
762
0718 0337 B7 DE 20                   STA  SECTOR
763
0719 033A 7C DE 1F                   INC TRACK
764
0720 033D B6 DE 1F                   LDA TRACK
765
0721 0340 81 40                      CMPA #RMAXTRK
766
0722 0342 26 C9                      BNE DFL2
767
0723                         * break free chain at last track/sector
768
0724 0344 8E DE 46                   LDX  #BUFFER
769
0725 0347 86 3F                      LDA  #RMAXTRK-1
770
0726 0349 C6 0E                      LDB  #RMAXSEC
771
0727 034B 9D 57                      JSR  READSC
772
0728 034D 8E DE 46                   LDX  #BUFFER
773
0729 0350 6F 84                      CLR  0,X
774
0730 0352 6F 01                      CLR  1,X
775
0731 0354 86 3F                      LDA  #RMAXTRK-1
776
0732 0356 C6 0E                      LDB  #RMAXSEC
777
0733 0358 9D 5B                      JSR  WRITSC
778
0734                         * set up sector structure, SIR, directory etc
779
0735 035A 8E DE 46                   LDX  #BUFFER
780
0736 035D 4F                         CLRA
781
0737 035E C6 0E                      LDB  #RMAXSEC
782
0738 0360 9D 57                      JSR  READSC
783
0739 0362 8E DE 46                   LDX  #BUFFER
784
0740 0365 6F 84                      CLR  0,X break end of directory chain
785
0741 0367 6F 01                      CLR  1,X
786
0742 0369 4F                         CLRA
787
0743 036A C6 0E                      LDB  #RMAXSEC
788
0744 036C 9D 5B                      JSR  WRITSC
789
0745                         *
790
0746 036E 8E DE 46                   LDX  #BUFFER
791
0747 0371 4F                         CLRA
792
0748 0372 C6 03                      LDB  #3 set up SIR
793
0749 0374 9D 57                      JSR  READSC
794
0750 0376 8E DE 46                   LDX  #BUFFER
795
0751 0379 6F 84                      CLR  0,X break forward link
796
0752 037B 6F 01                      CLR  1,X
797
0753 037D CC 52 41                   LDD  #$5241 set volume name (RAMDISK )
798
0754 0380 ED 88 10                   STD  16,X
799
0755 0383 CC 4D 44                   LDD  #$4D44
800
0756 0386 ED 88 12                   STD  18,X
801
0757 0389 CC 49 53                   LDD  #$4953
802
0758 038C ED 88 14                   STD  20,X
803
0759 038F CC 4B 20                   LDD  #$4B20
804
0760 0392 ED 88 16                   STD  22,X
805
0761 0395 CC 00 01                   LDD  #1 volume number
806
0762 0398 ED 88 1B                   STD  27,X
807
0763 039B CC 01 01                   LDD  #$0101 first trk/sec  01-01
808
0764 039E ED 88 1D                   STD  29,X
809
0765 03A1 86 3F                      LDA  #RMAXTRK-1
810
0766 03A3 C6 0E                      LDB  #RMAXSEC
811
0767 03A5 ED 88 1F                   STD  31,X
812
0768 03A8 ED 88 26                   STD  38,X
813
0769 03AB CC 03 72                   LDD  #RTOTSEC total DATA sectors (2912-14)
814
0770 03AE ED 88 21                   STD  33,X
815
0771                         *
816
0772 03B1 86 01                      LDA #01 month   set default creation date (SYS09's birthday!)
817
0773 03B3 A7 88 23                   STA 35,X
818
0774 03B6 86 07                      LDA #07 day
819
0775 03B8 A7 88 24                   STA 36,X
820
0776 03BB 86 07                      LDA #07 year
821
0777 03BD A7 88 25                   STA 37,X
822
0778                         *
823
0779 03C0 4F                 RF3     CLRA
824
0780 03C1 C6 03                      LDB  #3
825
0781 03C3 9D 5B                      JSR  WRITSC
826
0782                         *
827
0783 03C5 8E DE 46                   LDX #BUFFER
828
0784 03C8 4F                         CLRA
829
0785 03C9 C6 01                      LDB #1
830
0786 03CB 9D 57                      JSR READSC
831
0787 03CD 8E DE 46                   LDX #BUFFER
832
0788 03D0 86 AA                      LDA #$AA set the init flag
833
0789 03D2 A7 84                      STA 0,X
834
0790 03D4 86 55                      LDA  #$55
835
0791 03D6 A7 01                      STA 1,X
836
0792 03D8 4F                         CLRA
837
0793 03D9 C6 01                      LDB #1
838
0794 03DB 0E 5B                      JMP WRITSC
839
0795                         *
840
0796                         ********************************
841
0797                         *    System specific Boot      *
842
0798                         *    command goes here.        *
843
0799                         ********************************
844
0800                         *
845
0801                         * Boot FLEX from the FPGA's internal pre-loaded scratch RAM
846
0802                         *
847
0803 03DD 08 08              UBMESS  FCB $08, $08
848
0804 03DF 42 6F 6F 74 69 6E          FCC 'Booting internal FLEX....'
849
          67 20 69 6E 74 65
850
          72 6E 61 6C 20 46
851
          4C 45 58 2E 2E 2E
852
          2E
853
0805 03F8 0D 0A 04                   FCB $0D,$0A,$04
854
0806                         *
855
0807 03FB 8E 03 DD           UBSUB   LDX #UBMESS
856
0808 03FE BD 04 50                   JSR PDATA1
857
0809                         *
858
0810 0401 8E D3 E5                   LDX #$D3E5
859
0811 0404 10 8E 04 24                LDY #CONTAB Overlay console driver table
860
0812 0408 EC A1              UB1     LDD 0,Y++
861
0813 040A ED 81                      STD 0,X++
862
0814 040C 8C D3 FD                   CMPX #$D3FD
863
0815 040F 26 F7                      BNE UB1
864
0816                         *
865
0817 0411 8E DE 00                   LDX #$DE00 Overlay disk driver table
866
0818 0414 10 8E 04 3C                LDY #DISTAB
867
0819 0418 EC A1              UB2     LDD 0,Y++
868
0820 041A ED 81                      STD 0,X++
869
0821 041C 8C DE 1E                   CMPX #$DE1E
870
0822 041F 26 F7                      BNE UB2
871
0823                         *
872
0824 0421 7E CD 00           UBEND   JMP $CD00
873
0825                         *
874
0826                         * FLEX console jump table.
875
0827 0424 04 5C              CONTAB  FDB INPNE       INPUT NO ECHO
876
0828 0426 04 68                      FDB DUMMY       INTERRUPT HANDLER
877
f9-monex.txt, line no. 829: Symbol undefined Pass 2
878
0829 0428 00 02                      FDB MONRAM+$02 SWI VECTOR
879
f9-monex.txt, line no. 830: Symbol undefined Pass 2
880
0830 042A 00 08                      FDB MONRAM+$08 IRQ VECTOR
881
0831 042C 04 68                      FDB DUMMY       TIMER OFF
882
0832 042E 04 68                      FDB DUMMY       TIMER ON
883
0833 0430 04 68                      FDB DUMMY       TIMER INITIALIZATION
884
0834 0432 04 64                      FDB CONTRL      MONITOR
885
0835 0434 04 68                      FDB DUMMY       TERMINAL INITIALIZATION
886
0836 0436 04 60                      FDB STATUS      INPUT CHECK
887
0837 0438 04 54                      FDB OUTP        TERMINAL OUTPUT
888
0838 043A 04 58                      FDB INPE        TERMINAL INPUT WITH ECHO
889
0839                         *
890
0840                         * FLEX disk jump table.
891
0841 043C 0E 57              DISTAB  JMP READSC
892
0842 043E 0E 5B                      JMP WRITSC
893
0843 0440 0E 5F                      JMP BUSY
894
0844 0442 0E 63                      JMP RESTR1
895
0845 0444 0E 6C                      JMP DRVSEL
896
0846 0446 0E 9F                      JMP CHKRDY
897
0847 0448 0E A3                      JMP CHKQIK
898
0848 044A 0E A7                      JMP DINIT
899
0849 044C 0E BF                      JMP DWARM
900
0850 044E 0E C3                      JMP SEEKTS
901
0851                         *
902
0852                         * Monitor jumps
903
0853                         *
904
f9-monex.txt, line no. 854: Symbol undefined Pass 2
905
0854 0450 6E 9F 00 00        PDATA1  JMP [PDATAV]
906
f9-monex.txt, line no. 855: Symbol undefined Pass 2
907
0855 0454 6E 9F 00 00        OUTP    JMP [OUTCHV]
908
f9-monex.txt, line no. 856: Symbol undefined Pass 2
909
0856 0458 6E 9F 00 00        INPE    JMP [INCHEV]
910
f9-monex.txt, line no. 857: Symbol undefined Pass 2
911
0857 045C 6E 9F 00 00        INPNE   JMP [INCHV]
912
f9-monex.txt, line no. 858: Symbol undefined Pass 2
913
0858 0460 6E 9F 00 00        STATUS  JMP [INCHKV]
914
f9-monex.txt, line no. 859: Symbol undefined Pass 2
915
0859 0464 6E 9F 00 00        CONTRL  JMP [MONITV]
916
0860 0468 39                 DUMMY   RTS
917
0861                         *
918
0862                         ** 'UL' LOAD ROM DISK VIA SERIAL PORT
919
0863                         *
920
0864 0469 53 65 72 69 61 6C  ULMES   FCC  'Serial ROM Disk upload ...'
921
          20 52 4F 4D 20 44
922
          69 73 6B 20 75 70
923
          6C 6F 61 64 20 2E
924
          2E 2E
925
0865 0483 0D 0A 04                   FCB  $0D,$0A,$04
926
0866 0486 52 4F 4D 20 44 69  ULMES1  FCC  'ROM Disk Loaded'
927
          73 6B 20 4C 6F 61
928
          64 65 64
929
0867 0495 0D 0A 04                   FCB  $0D,$0A,$04
930
0868                         *
931
0869 0498 8E 04 69           ULSUB   LDX  #ULMES
932
0870 049B BD 04 50                   JSR  PDATA1
933
0871                         *
934
0872 049E 86 00                      LDA  #$00
935
0873 04A0 B7 DE 1E                   STA  DRVNUM
936
0874 04A3 4F                         CLRA         TRACK 0
937
0875 04A4 C6 01                      LDB  #$01    SECTOR 1
938
0876 04A6 B7 DE 1F           ULLOOP0 STA  TRACK
939
0877 04A9 F7 DE 20                   STB  SECTOR`
940
0878 04AC 17 FC 18                   LBSR MAPIN
941
0879                         *
942
0880 04AF 5F                         CLRB  xfer 256 bytes at a time.
943
0881 04B0 BD 04 D3           ULLOOP1 JSR  LRBYTE transfer should be hex bytes
944
0882 04B3 A7 C0                      STA  ,U+
945
0883 04B5 5A                         DECB
946
0884 04B6 26 F8                      BNE  ULLOOP1
947
0885                         *
948
0886 04B8 17 FC 3F                   LBSR MAPOUT
949
0887                         *
950
0888 04BB B6 DE 1F                   LDA  TRACK
951
0889 04BE F6 DE 20                   LDB  SECTOR
952
0890 04C1 5C                         INCB
953
0891 04C2 C1 0F                      CMPB #EMAXSEC+1
954
0892 04C4 26 E0                      BNE  ULLOOP0
955
0893 04C6 C6 01                      LDB  #1
956
0894 04C8 4C                         INCA
957
0895 04C9 81 30                      CMPA #EMAXTRK
958
0896 04CB 26 D9                      BNE  ULLOOP0
959
0897                         *
960
0898 04CD 8E 04 86           ULEXIT  LDX  #ULMES1
961
0899 04D0 7E 04 50                   JMP  PDATA1
962
0900                         *
963
0901                         * Read a byte from the serial port
964
0902                         *
965
0903 04D3 34 04              LRBYTE  PSHS B
966
0904 04D5 8D 0E                      BSR  LRHEX                  Get hex digit.
967
0905 04D7 48                         ASLA
968
0906 04D8 48                         ASLA                           Shift to msb.
969
0907 04D9 48                         ASLA
970
0908 04DA 48                         ASLA
971
0909 04DB 1F 89                      TFR  A,B                    Save in B.
972
0910 04DD 8D 06                      BSR  LRHEX                  Get next digit.
973
0911 04DF 34 04                      PSHS B
974
0912 04E1 AB E0                      ADDA 0,S+                    Add together bytes.
975
0913 04E3 35 84                      PULS B,PC
976
0914                         *
977
0915 04E5 BD 05 0B           LRHEX   JSR  INTER
978
0916 04E8 29 FB                      BVS  LRHEX
979
0917 04EA 80 30                      SUBA #$30                   Remove ascii bias.
980
0918 04EC 2B F7                      BMI  LRHEX
981
0919 04EE 81 09                      CMPA #$09                   Number?
982
0920 04F0 2F 0A                      BLE  LRHEX1                 Yes.
983
0921 04F2 81 11                      CMPA #$11                   Keep testing.
984
0922 04F4 2B EF                      BMI  LRHEX
985
0923 04F6 81 16                      CMPA #$16
986
0924 04F8 2E EB                      BGT  LRHEX
987
0925 04FA 80 07                      SUBA #$07
988
0926 04FC 39                 LRHEX1  RTS
989
0927                         *
990
0928                         * ACIA INPUT TEST
991
0929                         *
992
0930 04FD 96 00              INTEST  LDA ACIAC1
993
0931 04FF 85 01                      BITA #$01
994
0932 0501 39                         RTS
995
0933                         *
996
0934                         * RESET ACIA
997
0935                         *
998
0936 0502 86 03              ACIRST  LDA #$03 master reset
999
0937 0504 97 00                      STA  ACIAC1
1000
0938 0506 86 11                      LDA #$11
1001
0939 0508 97 00                      STA ACIAC1
1002
0940 050A 39                         RTS
1003
0941                         *
1004
0942                         * ACIA INPUT
1005
0943                         *
1006
0944 050B 86 10              INTER   LDA  #16
1007
0945 050D B7 DE 27                   STA  DELCNT+0
1008
0946 0510 7F DE 28                   CLR  DELCNT+1
1009
0947 0513 7F DE 29                   CLR  DELCNT+2
1010
0948 0516 96 00              INTER0  LDA  ACIAC1
1011
0949 0518 85 01                      BITA #$01
1012
0950 051A 26 08                      BNE  INTER1
1013
0951 051C 85 78                      BITA #$78
1014
0952 051E 27 09                      BEQ  INTER2
1015
0953 0520 8D E0                      BSR  ACIRST
1016
0954 0522 20 E7                      BRA  INTER
1017
0955                         *
1018
0956 0524 96 01              INTER1  LDA  ACIAD1
1019
0957 0526 1C 02                      ANDCC #VFLAG
1020
0958 0528 39                         RTS
1021
0959                         *
1022
0960 0529 7A DE 29           INTER2  DEC  DELCNT+2
1023
0961 052C 26 E8                      BNE  INTER0
1024
0962 052E 7A DE 28                   DEC  DELCNT+1
1025
0963 0531 26 E3                      BNE  INTER0
1026
0964 0533 7A DE 27                   DEC  DELCNT+0
1027
0965 0536 26 DE                      BNE  INTER0
1028
0966 0538 4F                         CLRA
1029
0967 0539 1A 02                      ORCC #VFLAG
1030
0968 053B 39                         RTS
1031
0969                         *
1032
0970                         * ACIA OUTPUT
1033
0971                         *
1034
0972 053C 34 02              OUTTER  PSHS A
1035
0973                         *
1036
0974 053E 96 00              OUTTE1  LDA ACIAC1
1037
0975 0540 85 02                      BITA #$02
1038
0976 0542 26 08                      BNE  OUTTE2
1039
0977 0544 85 78                      BITA #$78
1040
0978 0546 27 F6                      BEQ  OUTTE1
1041
0979 0548 8D B8                      BSR  ACIRST
1042
0980 054A 20 F2                      BRA  OUTTE1
1043
0981                         *
1044
0982 054C 35 02              OUTTE2  PULS A
1045
0983 054E 97 01                      STA ACIAD1
1046
0984 0550 39                         RTS
1047
0985                         *
1048
0986                         ** 'UX' Xmodem ROM Disk upload
1049
0987                         *
1050
0988 0551 0D 0A              UXMES   FCB $0D,$0A
1051
0989 0553 58 6D 6F 64 65 6D          FCC 'Xmodem ROM Disk Upload'
1052
          20 52 4F 4D 20 44
1053
          69 73 6B 20 55 70
1054
          6C 6F 61 64
1055
0990 0569 04                         FCB 4
1056
0991 056A 0D 0A              UXMES1  FCB $0D,$0A
1057
0992 056C 55 70 6C 6F 61 64          FCC 'Upload Complete'
1058
          20 43 6F 6D 70 6C
1059
          65 74 65
1060
0993 057B 04                         FCB 4
1061
0994 057C 0D 0A              UXMES2  FCB $0D,$0A
1062
0995 057E 55 70 6C 6F 61 64          FCC 'Upload Error'
1063
          20 45 72 72 6F 72
1064
0996 058A 04                         FCB 4
1065
0997                         *
1066
0998 058B 8E 05 51           UXSUB   LDX #UXMES
1067
0999 058E 17 FE BF                   LBSR PDATA1
1068
1000                         *
1069
1001 0591 86 01                      LDA  #1
1070
1002 0593 B7 DE 23                   STA BLKNUM
1071
1003 0596 8E 05 F9                   LDX  #XSTSTR
1072
1004 0599 BF DE 25                   STX  XSTATE
1073
1005                         *
1074
1006 059C 86 00                      LDA  #$00
1075
1007 059E B7 DE 1E                   STA  DRVNUM
1076
1008 05A1 4F                         CLRA         TRACK 0
1077
1009 05A2 C6 01                      LDB  #$01    SECTOR 1
1078
1010 05A4 B7 DE 1F           UXLOOP0 STA  TRACK
1079
1011 05A7 F7 DE 20                   STB  SECTOR
1080
1012 05AA 17 FB 1A                   LBSR MAPIN
1081
1013                         *
1082
1014 05AD 5F                         CLRB       xfer 256 bytes at a time.
1083
1015 05AE 17 00 2B           UXLOOP1 LBSR XBYTE transfer should be hex bytes
1084
1016 05B1 25 20                      BCS  UXERR
1085
1017 05B3 A7 C0                      STA  ,U+
1086
1018 05B5 5A                         DECB
1087
1019 05B6 26 F6                      BNE  UXLOOP1
1088
1020                         *
1089
1021 05B8 17 FB 3F                   LBSR MAPOUT
1090
1022                         *
1091
1023 05BB B6 DE 1F                   LDA  TRACK
1092
1024 05BE F6 DE 20                   LDB  SECTOR
1093
1025 05C1 5C                         INCB
1094
1026 05C2 C1 0F                      CMPB #EMAXSEC+1
1095
1027 05C4 26 DE                      BNE  UXLOOP0
1096
1028 05C6 C6 01                      LDB  #1
1097
1029 05C8 4C                         INCA
1098
1030 05C9 81 30                      CMPA #EMAXTRK
1099
1031 05CB 26 D7                      BNE  UXLOOP0
1100
1032                         *
1101
1033 05CD 8E 05 6A           UXEXIT  LDX  #UXMES1
1102
1034 05D0 7E 04 50                   JMP  PDATA1
1103
1035                         *
1104
1036 05D3 17 FB 24           UXERR   LBSR MAPOUT
1105
1037 05D6 8E 05 7C                   LDX  #UXMES2
1106
1038 05D9 16 FE 74                   LBRA PDATA1
1107
1039                         *
1108
1040                         * Get a Byte using XModem protocol
1109
1041                         * Carry clear => no errors
1110
1042                         * Carry set   => errors
1111
1043                         *
1112
1044 05DC 34 10              XBYTE   PSHS X
1113
1045 05DE BE DE 25                   LDX  XSTATE
1114
1046                         *
1115
1047 05E1 17 FF 27           XBYTE0  LBSR INTER
1116
1048 05E4 28 0A                      BVC  XBYTE1
1117
1049 05E6 86 15                      LDA  #NAK
1118
1050 05E8 17 FF 51                   LBSR OUTTER
1119
1051 05EB 8E 05 F9                   LDX  #XSTSTR
1120
1052 05EE 20 F1                      BRA  XBYTE0
1121
1053                         *
1122
1054 05F0 AD 84              XBYTE1  JSR  ,X
1123
1055 05F2 26 ED                      BNE  XBYTE0
1124
1056 05F4 BF DE 25                   STX  XSTATE
1125
1057 05F7 35 90                      PULS X,PC
1126
1058                         *
1127
1059                         * START - LOOK FOR SOH (START OF HEADER) = $01
1128
1060                         *
1129
1061 05F9 81 01              XSTSTR  CMPA #SOH
1130
1062 05FB 26 06                      BNE  XSTSTR1
1131
1063 05FD 8E 06 19                   LDX  #XSTBLK
1132
1064 0600 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, no valid data (no exit)
1133
1065 0602 39                         RTS
1134
1066                         *
1135
1067 0603 81 04              XSTSTR1 CMPA #EOT
1136
1068 0605 26 08                      BNE  XSTSTR2
1137
1069 0607 86 06                      LDA  #ACK
1138
1070 0609 17 FF 30                   LBSR OUTTER
1139
1071 060C 1A 05                      ORCC  #CFLAG+ZFLAG  Set (c)=1 abort & exit
1140
1072 060E 39                         RTS
1141
1073                         *
1142
1074 060F 81 18              XSTSTR2 CMPA #CAN
1143
1075 0611 26 03                      BNE  XSTSTR3
1144
1076 0613 1A 05                      ORCC  #CFLAG+ZFLAG  Set (c)=1 abort & exit
1145
1077 0615 39                         RTS
1146
1078                         *
1147
1079 0616 1C FA              XSTSTR3 ANDCC #$FF-CFLAG-ZFLAG
1148
1080 0618 39                         RTS
1149
1081                         *
1150
1082                         * Got SOH
1151
1083                         * Now get block number
1152
1084                         *
1153
1085 0619 B1 DE 23           XSTBLK  CMPA BLKNUM
1154
1086 061C 26 06                      BNE  XSTBLKE
1155
1087 061E 8E 06 2F                   LDX  #XSTCOM
1156
1088 0621 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1157
1089 0623 39                         RTS
1158
1090                         *
1159
1091                         * Error in block number
1160
1092                         *
1161
1093 0624 86 15              XSTBLKE LDA  #NAK
1162
1094 0626 17 FF 13                   LBSR OUTTER
1163
1095 0629 8E 05 F9                   LDX  #XSTSTR
1164
1096 062C 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1165
1097 062E 39                         RTS
1166
1098                         *
1167
1099                         * Get complement of block number
1168
1100                         *
1169
1101 062F 43                 XSTCOM  COMA
1170
1102 0630 B1 DE 23                   CMPA BLKNUM
1171
1103 0633 26 EF                      BNE  XSTBLKE
1172
1104 0635 7F DE 21                   CLR  CHKSUM
1173
1105 0638 86 80                      LDA  #128
1174
1106 063A B7 DE 24                   STA  BYTCNT
1175
1107 063D 8E 06 43                   LDX  #XSTDAT
1176
1108 0640 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, No valid data (no exit)
1177
1109 0642 39                         RTS
1178
1110                         *
1179
1111                         * Get data bytes
1180
1112                         *
1181
1113 0643 34 02              XSTDAT  PSHS A
1182
1114 0645 BB DE 21                   ADDA CHKSUM
1183
1115 0648 B7 DE 21                   STA  CHKSUM
1184
1116 064B 35 02                      PULS A
1185
1117 064D 7A DE 24                   DEC  BYTCNT
1186
1118 0650 26 03                      BNE  XSTDAT1
1187
1119 0652 8E 06 5A                   LDX  #XSTCHK
1188
1120 0655 1C FE              XSTDAT1 ANDCC #$FF-CFLAG No abort
1189
1121 0657 1A 04                      ORCC #ZFLAG      Valid data (exit)
1190
1122 0659 39                         RTS
1191
1123                         *
1192
1124                         * Byte count reached zero
1193
1125                         * Check checksum byte
1194
1126                         *
1195
1127 065A B1 DE 21           XSTCHK  CMPA CHKSUM
1196
1128 065D 26 07                      BNE  XSTCHK1 retry if wrong checksum
1197
1129                         *
1198
1130                         * Checksum OK ...
1199
1131                         * increment block number
1200
1132                         * and send ACK
1201
1133                         *
1202
1134 065F 7C DE 23                   INC  BLKNUM
1203
1135 0662 86 06                      LDA  #ACK
1204
1136 0664 20 0D                      BRA  XSTCHK2
1205
1137                         *
1206
1138                         * Checksum Error detected ...
1207
1139                         * Reset Sector counter in ACCB to last 128 byte boundary
1208
1140                         * and send NAK
1209
1141                         *
1210
1142 0666 34 04              XSTCHK1 PSHS B
1211
1143 0668 1F 30                      TFR  U,D
1212
1144 066A 5A                         DECB
1213
1145 066B C4 80                      ANDB #128
1214
1146 066D 1F 03                      TFR  D,U
1215
1147 066F 35 04                      PULS B
1216
1148 0671 86 15                      LDA  #NAK
1217
1149 0673 17 FE C6           XSTCHK2 LBSR OUTTER
1218
1150 0676 8E 05 F9                   LDX  #XSTSTR
1219
1151 0679 1C FA                      ANDCC #$FF-CFLAG-ZFLAG No abort, no valid data (no exit)
1220
1152 067B 39                         RTS
1221
1153                         *
1222
1154                         ** 'UP' Load ROMdisk via config PROM.
1223
1155                         *
1224
1156 067C 08 08              UPMES   FCB  $08,$08
1225
1157 067E 4C 6F 61 64 20 52          FCC  'Load ROM disk from config PROM.'
1226
          4F 4D 20 64 69 73
1227
          6B 20 66 72 6F 6D
1228
          20 63 6F 6E 66 69
1229
          67 20 50 52 4F 4D
1230
          2E
1231
1158 069D 04                         FCB  4
1232
1159 069E 46 6F 75 6E 64 20  UPMES1  FCC  'Found SYNC, loading data...'
1233
          53 59 4E 43 2C 20
1234
          6C 6F 61 64 69 6E
1235
          67 20 64 61 74 61
1236
          2E 2E 2E
1237
1160 06B9 0A 0D 04                   FCB  $0A,$0D,4
1238
1161 06BC 52 4F 4D 20 44 69  UPMES2  FCC  'ROM Disk Loaded.'
1239
          73 6B 20 4C 6F 61
1240
          64 65 64 2E
1241
1162 06CC 0A 0D 04                   FCB  $0A,$0D,4
1242
1163 06CF 52 4F 4D 20 44 69  UPMES3  FCC  'ROM Disk Not Found.'
1243
          73 6B 20 4E 6F 74
1244
          20 46 6F 75 6E 64
1245
          2E
1246
1164 06E2 0A 0D 04                   FCB  $0A,$0D,4
1247
1165                         *
1248
1166 06E5 8E 06 7C           UPSUB      LDX  #UPMES
1249
1167 06E8 BD 04 50                   JSR  PDATA1
1250
1168                         *
1251
1169 06EB 8D 5A                      BSR  UPRESET
1252
1170 06ED 10 8E 00 20                LDY  #$0020  Set up count for 2 MBit
1253
1171 06F1 8E 00 00                   LDX  #$0000
1254
1172 06F4 8D 6C              UPSUB1  BSR  UPBIT   Shift in bit
1255
1173 06F6 8D 7C                      BSR  UPSYNC  Test for Sync pattern`
1256
1174 06F8 27 15                      BEQ  UPSUB4  Skip if found
1257
1175 06FA 30 1F                      LEAX -1,X    Count Down inner loop
1258
1176 06FC 8C 00 00                   CMPX #$0000
1259
1177 06FF 26 F3                      BNE  UPSUB1   Branch if inner loop not complete
1260
1178 0701 31 1F                      LEAY -1,X    Count down outer loop
1261
1179 0703 10 8C 00 00                CMPY #$0000
1262
1180 0707 26 EB                      BNE  UPSUB1   Branch if outer loop not complete
1263
1181                         *
1264
1182 0709 8E 06 CF                   LDX  #UPMES3 2MBits scanned, no synch, report error
1265
1183 070C 7E 04 50                   JMP  PDATA1
1266
1184                         *
1267
1185 070F 8E 06 9E           UPSUB4  LDX  #UPMES1 Sync found, now load disk
1268
1186 0712 BD 04 50                   JSR  PDATA1
1269
1187                         *
1270
1188 0715 4F                         CLRA
1271
1189 0716 B7 DE 1E                   STA  DRVNUM   select Drive 0
1272
1190 0719 C6 01                      LDB  #$01
1273
1191 071B B7 DE 1F           UPSUB2  STA  TRACK   track 0
1274
1192 071E F7 DE 20                   STB  SECTOR  sector 1
1275
1193                         *
1276
1194 0721 17 F9 A3                   LBSR MAPIN   map in buffer
1277
1195 0724 5F                         CLRB         256 byte sector
1278
1196 0725 8D 67              UPSUB3  BSR  UPBYTE  read byte from prom
1279
1197 0727 A7 C0                      STA  ,U+     Store in buffer
1280
1198 0729 5A                         DECB
1281
1199 072A 26 F9                      BNE  UPSUB3  Loop until sector read`
1282
1200 072C 17 F9 CB                   LBSR MAPOUT  map out buffer
1283
1201                         *
1284
1202 072F B6 DE 1F                   LDA  TRACK   Advance sector
1285
1203 0732 F6 DE 20                   LDB  SECTOR
1286
1204 0735 5C                         INCB
1287
1205 0736 C1 0F                      CMPB #EMAXSEC+1 Wrap on max sector count
1288
1206 0738 26 E1                      BNE  UPSUB2
1289
1207 073A C6 01                      LDB  #1
1290
1208 073C 4C                         INCA          Advance track
1291
1209 073D 81 30                      CMPA #EMAXTRK
1292
1210 073F 26 DA                      BNE  UPSUB2
1293
1211                         *
1294
1212 0741 8E 06 BC           UPEXIT  LDX  #UPMES2  Load complete, report message
1295
1213 0744 7E 04 50                   JMP  PDATA1
1296
1214                         *
1297
1215                         * Reset Serial PROM
1298
1216                         *
1299
f9-monex.txt, line no. 1217: Symbol undefined Pass 2
1300
1217 0747 86 00              UPRESET LDA  #PRSTHI    Strobe the reset line
1301
f9-monex.txt, line no. 1218: Symbol undefined Pass 2
1302
1218 0749 97 00                      STA  PROMREG
1303
f9-monex.txt, line no. 1219: Symbol undefined Pass 2
1304
1219 074B 86 00                      LDA  #PRSTLO
1305
f9-monex.txt, line no. 1220: Symbol undefined Pass 2
1306
1220 074D 97 00                      STA  PROMREG
1307
1221 074F 8E 00 00                   LDX  #$0000     Delay a while`
1308
f9-monex.txt, line no. 1222: Phasing Error
1309
1222 0752 30 1F              UPRST1  LEAX -1,X
1310
1223 0754 8C 00 00                   CMPX #$0000
1311
1224 0757 26 FB                      BNE  UPRST1
1312
1225 0759 BF DF 46                   STX  SYNCREG+0  Clear Sync Shift Register
1313
1226 075C BF DF 48                   STX  SYNCREG+2
1314
1227 075F 39                         RTS
1315
1228                         *
1316
1229                         * Input 1 Bit From PROM
1317
1230                         *
1318
f9-monex.txt, line no. 1231: Phasing Error
1319
f9-monex.txt, line no. 1231: Symbol undefined Pass 2
1320
1231 0760 86 00              UPBIT   LDA  #PCLKHI
1321
f9-monex.txt, line no. 1232: Symbol undefined Pass 2
1322
1232 0762 97 00                      STA  PROMREG
1323
f9-monex.txt, line no. 1233: Symbol undefined Pass 2
1324
1233 0764 86 00                      LDA  #PCLKLO
1325
f9-monex.txt, line no. 1234: Symbol undefined Pass 2
1326
1234 0766 97 00                      STA  PROMREG
1327
f9-monex.txt, line no. 1235: Symbol undefined Pass 2
1328
1235 0768 96 00                      LDA  PROMREG
1329
1236 076A 44                         LSRA
1330
1237 076B 78 DF 49                   ASL  SYNCREG+3
1331
1238 076E 39                         RTS
1332
1239                         *
1333
1240                         * Test for 32 bit Sync Word
1334
1241                         *
1335
f9-monex.txt, line no. 1242: Phasing Error
1336
1242 076F 79 DF 48           UPSYNC  ROL  SYNCREG+2
1337
1243 0772 79 DF 47                   ROL  SYNCREG+1
1338
1244 0775 79 DF 46                   ROL  SYNCREG+0
1339
f9-monex.txt, line no. 1245: Symbol undefined Pass 2
1340
1245 0778 CC 00 00                   LDD  #SYNCLO
1341
1246 077B 10 B3 DF 48                CMPD SYNCREG+2
1342
1247 077F 26 0C                      BNE  UPSYNCX
1343
f9-monex.txt, line no. 1248: Symbol undefined Pass 2
1344
1248 0781 CC 00 00                   LDD  #SYNCHI
1345
1249 0784 10 B3 DF 46                CMPD SYNCREG+0
1346
f9-monex.txt, line no. 1250: Phasing Error
1347
1250 0788 39                 UPSYNCX RTS
1348
1251                         *
1349
1252                         * Input 1 Byte From PROM
1350
1253                         *
1351
f9-monex.txt, line no. 1254: Phasing Error
1352
1254 0789 34 04              UPBYTE  PSHS B
1353
1255 078B C6 08                      LDB  #8
1354
f9-monex.txt, line no. 1256: Phasing Error
1355
1256 078D 8D D3              UPBYTE1 BSR  UPBIT
1356
1257 078F 5A                         DECB
1357
1258 0790 26 00                      BNE  UPBYTE1
1358
1259 0792 B6 DF 49                   LDA  SYNCREG+3
1359
1260 0795 35 84                      PULS B,PC
1360
1261                         *
1361
1262                         ***** NEXTCMD *****
1362
1263                         *
1363
f9-monex.txt, line no. 1264: Phasing Error
1364
1264 0797 17 FC BE           NEXTEXT LBSR INPE  GET ONE CHAR. FROM TERMINAL
1365
1265 079A 84 7F                      ANDA #$7F STRIP PARITY FROM CHAR.
1366
1266 079C 1F 89                      TFR  A,B
1367
1267 079E 86 20                      LDA  #$20
1368
1268 07A0 17 FC B1                   LBSR OUTP PRNT SPACE
1369
1269 07A3 C1 60                      CMPB #$60
1370
1270 07A5 2F 07                      BLE NXTEX0
1371
1271 07A7 C0 20                      SUBB #$20
1372
1272                         *
1373
1273                         ***** DO TABLE LOOKUP *****
1374
1274                         *   FOR COMMAND FUNCTIONS
1375
1275                         *
1376
f9-monex.txt, line no. 1276: Phasing Error
1377
1276 07A9 8E 07 C4           NXTEX0  LDX #EXTTAB    POINT TO JUMP TABLE
1378
f9-monex.txt, line no. 1277: Phasing Error
1379
1277 07AC E1 80              NXTEX1  CMPB ,X+       DOES COMMAND MATCH TABLE ENTRY ?
1380
1278 07AE 27 12                      BEQ  JMPEXT    BRANCH IF MATCH FOUND
1381
1279 07B0 30 02                      LEAX 2,X       POINT TO NEXT ENTRY IN TABLE
1382
1280 07B2 8C 07 D3                   CMPX #EXTEND   REACHED END OF TABLE YET ?
1383
1281 07B5 26 FA                      BNE  NXTEX1    IF NOT END, CHECK NEXT ENTRY
1384
1282 07B7 8E 07 D3                   LDX  #MSGWHAT  POINT TO MSG "WHAT?"
1385
1283 07BA 16 FC 93                   LBRA PDATA1    PRINT MSG AND RETURN
1386
f9-monex.txt, line no. 1284: Phasing Error
1387
1284 07BD 6E 94              JMPEXT  JMP  [,X]      JUMP TO COMMAND ROUTINE
1388
1285                         *
1389
1286                         * EXTENDED COMMAND JUMP TABLE
1390
1287                         *
1391
f9-monex.txt, line no. 1288: Phasing Error
1392
1288 07BF                    EXTTAB EQU *
1393
1289 07BF 42                        FCC 'B'   BOOT FLEX
1394
1290 07C0 03 FB                     FDB UBSUB
1395
1291 07C2 4C                        FCC 'L'   LOAD ROM DISK OVER SERIAL PORT
1396
1292 07C3 04 98                     FDB ULSUB
1397
1293 07C5 46                        FCC 'F'   FORMAT RAM DISK
1398
1294 07C6 02 D7                     FDB UFSUB
1399
1295 07C8 50                        FCC 'P'   LOAD ROM DISK FROM PROM
1400
1296 07C9 06 E5                     FDB UPSUB
1401
1297 07CB 58                        FCC 'X'   XMODEM ROM DISK UPLOAD
1402
1298 07CC 05 8B                     FDB UXSUB
1403
1299                         *
1404
f9-monex.txt, line no. 1300: Phasing Error
1405
1300 07CE                    EXTEND EQU *
1406
1301                         *
1407
f9-monex.txt, line no. 1302: Phasing Error
1408
1302 07CE 57 48 41 54 20 3F  MSGWHAT FCC "WHAT ?"
1409
1303 07D4 0A 0D 04                   FCB $0A,$0D,$04
1410
1304                                END
1411
Program + Init Data = 2047 bytes
1412
Error count = 68

powered by: WebSVN 2.1.0

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