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

Subversion Repositories System11

[/] [System11/] [trunk/] [sw/] [SwtBug11.txt] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dilbert57
 NAM SWTBUG
2
*      VERSION 1.00
3
 
4
 OPT l
5
****************************************************
6
*REPLACEMENT FOR MIKBUG ROM
7
*FOR SWTPC 6800 COMPUTER SYSTEM
8
*COPYRIGHT 1977
9
*SOUTHWEST TECHNICAL PROD. CORP.
10
*AUGUST, 1977
11
****************************************************
12
*
13
* Revised for the 68HC11
14
* 15 December 2002
15
* John E. Kent
16
*
17
 ORG $A000
18
IRQ RMB 2 IRQ POINTER
19
BEGA RMB 2 BEGINNING ADDR PNCH
20
ENDA RMB 2 ENDING ADDR PNCH
21
NMI RMB 2 NMI INTERRUPT VECTOR
22
SP RMB 1 S HIGH
23
 RMB 1 S LOW
24
PORADD RMB 2 PORT ADDRESS
25
PORECH RMB 1 ECHO ON/OFF FLAG
26
XHI RMB 1 XREG HIGH
27
XLOW RMB 1 XREG LOW
28
CKSM RMB 1 CHECKSUM
29
XTEMP RMB 2 X-REG TEMP STGE
30
SWIJMP RMB 2 SWI JUMP VECTOR
31
TW EQU $A044 TEMPORARY STORAGE
32
TEMP EQU $A046 TEMPORARY STORAGE
33
BYTECT EQU $A047 BYTECT AND MCONT TEMP.
34
CTLPOR EQU $8004 CONTROL PORT ADDRESS
35
PROM EQU $C000 JUMP TO PROM ADDRESS
36
BKPT RMB 2 BREAKPOINT ADDRESS
37
BKLST RMB 1 BREAKPOINT DATA
38
*
39
* Two more bytes added to the stack
40
* for the IY register
41
*
42
 ORG $A040
43
STACK RMB 1 SWTBUG STACK
44
*
45
 ORG $E000
46
*
47
*I/O INTERRUPT SEQUENCE
48
IRQV LDX IRQ
49
 JMP 0,X
50
*
51
*JUMP TO USER PROGRAM
52
JUMP BSR BADDR
53
 JMP 0,X
54
*
55
CURSOR FCB $10,$16,4 CT-1024 CURSOR CONTROL
56
*
57
*ASCII LOADING ROUTINE
58
LOAD JSR RDON READER ON, DIS ECHO, GET P#
59
LOAD3 BSR INCH
60
 CMPA #'S
61
 BNE LOAD3 1ST CHAR NOT S
62
 BSR INCH READ CHAR
63
 CMPA #'9
64
 BEQ LOAD21
65
 CMPA #'1
66
 BNE LOAD3 2ND CHAR NOT 1
67
 CLR CKSM ZERO CHECKSUM
68
 BSR BYTE READ BYTE
69
 SUBA #2
70
 STAA BYTECT BYTE COUNT
71
*BUILD ADDRESS
72
 BSR BADDR
73
*STORE DATA
74
LOAD11 BSR BYTE
75
 DEC BYTECT
76
 BEQ LOAD15 ZERO BYTE COUNT
77
 STAA 0,X STORE DATA
78
 CMPA 0,X DATA STORED?
79
 BNE LOAD19
80
 INX
81
 BRA LOAD11
82
LOAD15 INC CKSM
83
 BEQ LOAD3
84
LOAD19 LDAA #'?
85
 BSR OUTCH
86
LOAD21 JMP RDOFF1
87
*
88
*BUILD ADDRESS
89
BADDR BSR BYTE READ 2 FRAMES
90
 STAA XHI
91
 BSR BYTE
92
 STAA XLOW
93
 LDX XHI LOAD IXR WITH NUMBER
94
 RTS
95
*
96
*INPUT BYTE (TWO FRAMES)
97
BYTE BSR INHEX GET HEX CHAR
98
BYTE1 ASLA
99
 ASLA
100
 ASLA
101
 ASLA
102
 TAB
103
 BSR INHEX
104
 ABA
105
 TAB
106
 ADDB CKSM
107
 STAB CKSM
108
 RTS
109
*
110
OUTHL LSRA OUT HEX LEFT BCD DIGIT
111
 LSRA
112
 LSRA
113
 LSRA
114
OUTHR ANDA #$F OUT HEX RIGHT BCD DIGIT
115
 ADDA #$30
116
 CMPA #$39
117
 BLS OUTCH
118
 ADDA #$7
119
*
120
*OUTPUT ONE CHAR
121
OUTCH JMP OUTEEE
122
INCH JMP INEEE
123
*
124
*PRINT DATA POINTED TO BY X REG
125
PDATA2 BSR OUTCH
126
 INX
127
PDATA1 LDAA 0,X
128
 CMPA #4
129
 BNE PDATA2
130
 RTS STOP ON HEX 04
131
*
132
C1 JMP SWTCTL
133
*
134
*MEMORY EXAMINE AND CHANGE
135
CHANGE BSR BADDR
136
CHA51 LDX #MCL
137
 BSR PDATA1 C/R L/F
138
 LDX #XHI
139
 BSR OUT4HS PRINT ADDRESS
140
 LDX XHI
141
 BSR OUT2HS PRINT OLD DATA
142
 BSR OUTS OUTPUT SPACE
143
ANOTH BSR INCH INPUT CHAR
144
 CMPA #$20
145
 BEQ ANOTH
146
 CMPA #$D
147
 BEQ C1
148
 CMPA #'^ UP ARROW?
149
 BRA AL3 BRANCH FOR ADJUSTMENT
150
 NOP
151
*
152
*INPUT HEX CHARACTER
153
INHEX BSR INCH
154
INHEX1 SUBA #$30
155
 BMI C3
156
 CMPA #$9
157
 BLE IN1HG
158
 CMPA #$11
159
 BMI C3 NOT HEX
160
 CMPA #$16
161
 BGT C3 NOT HEX
162
 SUBA #7
163
IN1HG RTS
164
*
165
OUT2H LDAA 0,X OUTPUT 2 HEX CHAR
166
OUT2HA BSR OUTHL OUT LEFT HEX CHAR
167
 LDAA 0,X
168
 INX
169
 BRA OUTHR OUTPUT RIGHT HEX CHAR
170
*
171
OUT4HS BSR OUT2H OUTPUT 4 HEX CHAR + SPACE
172
OUT2HS BSR OUT2H OUTPUT 2 HEX CHAR + SPACE
173
*
174
OUTS LDAA #$20 SPACE
175
 BRA OUTCH (BSR & TRS)
176
*
177
*ENTER POWER ON SEQUENCE
178
START LDS #STACK
179
 BRA AL1 BRANCH FOR ADDRESS COMPATIBIL
180
*
181
********************************************
182
*PART OF MEMORY EXAMINE AND CHANGE
183
AL3 BNE SK1
184
 DEX
185
 DEX
186
 STX XHI
187
 BRA CHA51
188
SK1 STX XHI
189
 BRA AL4
190
*
191
EOE3 BRA CONTRL BRANCH FOR MIKBUG EQUIV. CONT
192
*
193
AL4 CMPA #$30
194
 BCS CHA51
195
 CMPA #$46
196
 BHI CHA51
197
 BSR INHEX1
198
 JSR BYTE1
199
 DEX
200
 STAA 0,X CHANGE MEMORY
201
 CMPA 0,X
202
 BEQ CHA51 DID CHANGE
203
 JMP LOAD19 DIDN'T CHANGE
204
C3 LDS SP
205
 BRA SWTCTL
206
**************************************************
207
*
208
*CONTINUE POWER UP SEQUENCE
209
AL1 STS SP INIT TARGET STACK PTR.
210
 LDAA #$FF
211
 JSR SWISET
212
*CONFIGURE FOR PIA AND SEE IF OK
213
 LDX #CTLPOR
214
 JSR PIAINI INIT PIA
215
 LDAA 0,X
216
 CMPA 2,X
217
 BRA AL2
218
*
219
 BRA PRINT BRA FOR BILOAD
220
*
221
AL2 BNE CONTRL
222
*
223
*INITIALIZE AS ACIA
224
 LDAA #3 ACIA MASTER RESET
225
 STAA 0,X
226
 LDAA #$11
227
 STAA 0,X
228
 BRA CONTRL
229
*
230
*ENTER FROM SOFTWARE INTERRUPT
231
SF0 NOP
232
SFE1 STS SP SAVE TARGETS STACK POINTER
233
*DECREMENT P COUNTER
234
 TSX
235
 TST 6,X
236
 BNE *+4
237
 DEC 5,X
238
 DEC 6,X
239
*PRINT CONTENTS OF STACK.
240
PRINT LDX #MCL
241
 JSR PDATA1
242
 LDX SP
243
 INX
244
 BSR OUT2HS COND CODES
245
 BSR OUT2HS ACC B
246
 BSR OUT2HS ACC A
247
 JMP PATCH1
248
 NOP
249
* BSR OUT4HS IXR
250
* BSR OUT4HS PGM COUNTER
251
PATCH2 LDX #SP
252
 JSR OUT4HS STACK POINTER
253
SWTCTL LDX SWIJMP
254
 CPX #SF0
255
 BEQ CONTR1
256
*
257
CONTRL LDS #STACK SET CONTRL STACK POINTER
258
 LDX #CTLPOR RESET TO CONTROL PORT
259
 STX PORADD
260
 CLR PORECH TURN ECHO ON
261
 BSR SAVGET GET PORT # AND TYPE
262
 BEQ POF1
263
 JSR PIAECH SET PIA ECHO ON IF MP-C INTER
264
POF1 JSR PNCHOF TURN PUNCH OFF
265
 JSR RDOFF TURN READER OFF
266
CONTR1 LDX #MCLOFF
267
 JSR PDATA1 PRINT DATA STRING
268
 BSR INEEE READ COMMAND CHARACTER
269
*
270
*COMMAND LOOKUP ROUTINE
271
LOOK LDX #TABLE
272
OVER CMPA 0,X
273
 BNE SK3
274
 JSR OUTS SKIP SPACE
275
 LDX 1,X
276
 JMP 0,X
277
SK3 INX
278
 INX
279
 INX
280
 CPX #TABEND+3
281
 BNE OVER
282
SWTL1 BRA SWTCTL
283
*
284
*SOFTWARE INTERRUPT ENTRY POINT
285
SFE LDX SWIJMP JUMP TO VECTORED SOFTWARE INT
286
 JMP 0,X
287
*
288
S9 FCB 'S,'9,4 END OF TAPE
289
*
290
***************************************************
291
MTAPE1 FCB $D,$A,$15,0,0,0,'S,'1,4 PUNCH FORMAT
292
*
293
MCLOFF FCB $13 READER OFF
294
MCL FCB $D,$A,$15,0,0,0,'$,4
295
*
296
EIA5 BRA BILD BINARY LOADER INPUT
297
***************************************************
298
*
299
*
300
*NMI SEQUENCE
301
NMIV LDX NMI GET NMI VECTOR
302
 JMP 0,X
303
*
304
INEEE BRA INEEE1
305
*
306
*BYTE SEARCH ROUTINE
307
SEARCH JSR BADDR GET TOP ADDRESS
308
 STX ENDA
309
 JSR BADDR GET BOTTOM ADDRESS
310
 JSR BYTE GET BYTE TO SEARCH FOR
311
 TAB
312
OVE LDAA 0,X
313
 STX XHI
314
 CBA
315
 BEQ PNT
316
 BRA INCR1
317
PNT LDX #MCL
318
 JSR PDATA1
319
 LDX #XHI
320
 BRA SKP0
321
***************************************************
322
*
323
*GO TO USER PROGRAM ROUTINE
324
GOTO RTI
325
OUTEEE BRA OUTEE1
326
*
327
*
328
*
329
*SAVE IXR AND LOAD IXR WITH CORRECT
330
*PORT NUMBER AND TEST FOR TYPE
331
SAVGET STX XTEMP STORE INDEX REGISTER
332
GETPT1 LDX PORADD
333
ISACIA PSHB
334
 LDAB 1,X
335
 CMPB 3,X
336
 PULB
337
 RTS
338
***************************************************
339
*
340
*CONTINUATION OF SEARCH ROUTINE
341
SKP0 JSR OUT4HS
342
 LDX XHI
343
INCR1 CPX ENDA
344
 BEQ SWTL1
345
 INX
346
 BRA OVE
347
*
348
INEEE1 BSR INCH8 INPUT 8 BIT CHARACTER
349
 ANDA #%01111111 GET RID OF PARITY BIT
350
 RTS
351
*
352
BILD INS FIX UP STACK WHEN USING
353
 INS BINARY LOADER ON SWTPC TAPES
354
 INS
355
*
356
*INPUT ONE CHAR INTO ACC B
357
INCH8 PSHB SAVE ACC B
358
 BSR SAVGET SAVE IXR, GET PORT# AND TYPE
359
 BNE IN1 INPUT FROM PIA IF NOT
360
 LDAA #$15 RECONFIG FOR 8 BIT, 1 SB
361
 STAA 0,X
362
ACIAIN LDAA 0,X
363
 ASRA
364
 BCC ACIAIN NOT READY
365
 LDAA 1,X LOAD CHAR
366
 LDAB PORECH
367
 BEQ ACIOUT ECHO
368
 BRA RES DON'T ECHO
369
*
370
*OUTPUT ONE CHARACTER
371
OUTEE1 PSHB SAVE ACC B
372
 BSR SAVGET
373
 BNE IOUT
374
*
375
ACIOUT LDAB #$11
376
 STAB 0,X
377
ACIOU1 LDAB 0,X
378
 ASRB
379
 ASRB
380
 BCC ACIOU1 ACIA NOT READY
381
 STAA 1,X OUTPUT CHARACTER
382
RES PULB RESTORE ACC B
383
 LDX XTEMP
384
 RTS
385
*
386
*PIA INPUT ROUTINE
387
IN1 LDAA 0,X LOOK FOR START BIT
388
 BMI IN1
389
 BSR DDL DELAY HALF BIT TIME
390
 LDAB #4 SET DEL FOR FULL BIT TIME
391
 STAB 2,X
392
 ASLB SET UP CNTR WITH 8
393
IN3 BSR DEL WAIT ONE CHAR TIME
394
 SEC
395
 ROL 0,X
396
 RORA
397
 DECB
398
 BNE IN3
399
 BSR DEL WAIT FOR STOP BIT
400
 LDAB PORECH IS ECHO DESIRED?
401
 BEQ IOUT2 ECHO
402
 BRA RES RESTORE IXR,ACCB
403
*PIA OUTPUT ROUTINE
404
IOUT BSR DDL1 DELAY ONE HALF BIT TIME
405
 LDAB #$A SET UP COUNTER
406
 DEC 0,X SET START BIT
407
 BSR DE START TIMER
408
OUT1 BSR DEL DELAY ONE BIT TIME
409
 STAA 0,X PUT OUT ONE DATA BIT
410
 SEC
411
 RORA SHIFT IN NEXT BIT
412
 DECB DECREMENT COUNTER
413
 BNE OUT1 TEST FOR 0
414
IOUT2 LDAB 2,X TEST FOR STOP BITS
415
 ASLB SHIFT BIT TO SIGN
416
 BPL RES BRA FOR 1 STOP BIT
417
 BSR DEL DELAY FOR STOP BITS
418
 BRA RES
419
DEL TST 2,X IS TIME UP
420
 BPL DEL
421
DE INC 2,X RESET TIMER
422
 DEC 2,X
423
 RTS
424
*
425
DDL CLR 2,X HALF BIT DELAY
426
DDL1 BSR DE
427
 BRA DEL
428
*
429
*
430
*OPTIONAL PORT ROUTINE
431
OPTL BSR INEEE1
432
 TAB
433
 CLR PORADD+1 SET I/O ADDRESS FOR $8000
434
 LDX PORADD
435
 BSR PIAINI INITIALIZE PIA
436
 BSR PIAECH SET ECHO
437
 LDX #TABLE1 P, L OR E
438
 TBA
439
 JMP OVER LOOK AT TABLE FOR E, L OR P
440
*
441
PIAECH LDAA #$34 SET DDR
442
 STAA 3,X
443
 STAA 2,X
444
NOOPT RTS
445
*
446
*PIA INITIALIZATION ROUTINE
447
PIAINI INC 0,X SET DDR
448
 LDAA #$7
449
 STAA 1,X
450
 INC 0,X
451
 STAA 2,X
452
 RTS
453
*
454
*MINIFLOPPY DISK BOOT
455
DISK CLR $8014
456
 BSR DELAY
457
 LDAB #$0B
458
 BSR RETT2
459
LOOP1 LDAB 4,X
460
 BITB #1
461
 BNE LOOP1
462
 CLR 6,X
463
 BSR RETURN
464
 LDAB #$9C
465
 BSR RETT2
466
 LDX #$2400
467
LOOP2 BITB #2
468
 BEQ LOOP3
469
 LDAA $801B
470
 STAA 0,X
471
 INX
472
LOOP3 LDAB $8018
473
 BITB #1
474
 BNE LOOP2
475
 JMP $2400
476
RETT2 STAB 4,X
477
RETURN BSR RETT1
478
RETT1 RTS
479
*
480
*GENERAL PURPOSE DELAY LOOP
481
DELAY LDX #$FFFF
482
DELAY1 DEX
483
 CPX #$8014 STOP AT 8014
484
DUM BNE DELAY1
485
 RTS
486
*
487
*
488
*CLRAR SCREEN FOR CT-1024 TYPE TERMINALS
489
CLEAR LDX #CURSOR
490
 JSR PDATA1
491
 BSR DELAY1 DELAY
492
RDOFF1 JSR RDOFF
493
 BRA C4
494
*
495
*BREAKPOINT ENTERING ROUTINE
496
BREAK LDX #SF0
497
 CPX SWIJMP BREAKPOINTS ALREADY IN USE?
498
 BEQ INUSE
499
 INX
500
BREAK0 BSR STO1
501
 JSR BADDR
502
 STX BKPT
503
 LDAA 0,X
504
 STAA BKLST
505
 LDAA #$3F
506
 STAA 0,X
507
 LDX #SF0
508
 BSR STO1
509
 JMP CONTR1
510
INUSE LDX BKPT
511
 LDAA BKLST
512
 STAA 0,X
513
 LDX #SFE1
514
 BRA BREAK0
515
*
516
SWISET STAA STACK+1 FIX POWER UP INTERRUPT
517
 LDX SWIJMP
518
 CPX #SF0
519
 BEQ STORTN
520
STO LDX #SFE1
521
STO1 STX SWIJMP
522
STORTN RTS
523
*
524
PUNCH1 BSR PUNCH
525
 BRA POFC4
526
*
527
*FORMAT END OF TAPE WITH PGM. CTR. AND S9
528
PNCHS9 LDX #$A049
529
 STX ENDA
530
 DEX
531
 BSR PUNCH2
532
 LDX #S9
533
PDAT JSR PDATA1
534
POFC4 BSR PNCHOF
535
 BSR DELAY
536
C4 JMP CONTRL
537
*
538
RDON COM PORECH DISABLE ECHO FOR ACIA
539
 LDAA #$11 RON CHAR.
540
 LDAB #$20 STROBE CHAR
541
 BSR STROBE
542
 JSR ISACIA CHECK TO SEE IF PIA
543
 BEQ RTNN
544
 LDAA #$3C DISABLE PIA ECHO IF PIA
545
 STAA 3,X
546
RTNN RTS
547
*
548
RDOFF LDAA #$13 TURN READER OFF
549
 LDAB #$10
550
 BRA STROBE
551
*
552
PNCHON LDAA #$12
553
 LDAB #4
554
 BRA STROBE
555
*
556
PNCHOF LDAA #$14
557
 LDAB #$8
558
*
559
*PIA STROBING ROUTINE FOR PUNCH/READ ON/OFF
560
STROBE JSR OUTCH
561
 JSR GETPT1
562
* BEQ RTN1
563
 BRA RTN1
564
*
565
* New code for stack dump
566
*
567
PATCH1 JSR OUT4HS IXR
568
 JSR OUT4HS IYR
569
 JSR OUT4HS PGM COUNTER
570
 JMP PATCH2
571
* LDAA #2
572
* ORAB #1
573
* BSR STR2
574
* BSR STR1
575
* LDAA #2
576
* LDAB #1
577
 STAB 0,X
578
 BSR STR2
579
STR1 LDAA #6
580
STR2 STAA 1,X
581
 STAB 0,X
582
RTN1 RTS
583
*
584
*PUNCH FROM BEGINNING ADDRESS (BEGA) THRU
585
*ENDING ADDRESS (ENDA)
586
PUNCH LDX BEGA
587
PUNCH2 STX TW
588
 BSR PNCHON
589
PUN11 LDAA ENDA+1
590
 SUBA TW+1
591
 LDAB ENDA
592
 SBCB TW
593
 BNE PUN22
594
 CMPA #16
595
 BCS PUN23
596
PUN22 LDAA #15
597
PUN23 ADDA #4
598
 STAA BYTECT
599
 SUBA #3
600
 STAA TEMP
601
*PUNCH C/R L/F NULLS S1
602
 LDX #MTAPE1
603
 JSR PDATA1
604
 CLRB
605
*PUNCH FRAME COUNT
606
 LDX #BYTECT
607
 BSR PUNT2 PUNCH 2 HEX CHARACTERS
608
*PUNCH ADDRESS
609
 LDX #TW
610
 BSR PUNT2
611
 BSR PUNT2
612
*PUNCH DATA
613
 LDX TW
614
PUN32 BSR PUNT2 PUNCH ONE BYTE
615
 DEC TEMP
616
 BNE PUN32
617
 STX TW
618
 COMB
619
 PSHB
620
 TSX
621
 BSR PUNT2 PUNCH CHECKSUM
622
 PULB RESTORE STACK
623
 LDX TW
624
 DEX
625
 CPX ENDA
626
 BNE PUN11
627
RTN5 RTS
628
*
629
*PUNCH 2 HEX CHAR, UPDATE CHECKSUM
630
PUNT2 ADDB 0,X
631
 JMP OUT2H OUTPUT 2 HEX CHAR AND RTS
632
*
633
*COMMAND TABLE
634
TABLE FCB 'G GOTO
635
 FDB GOTO
636
 FCB 'Z GOTO PROM
637
 FDB PROM
638
 FCB 'M MEMORY EXAM AND CHANGE
639
 FDB CHANGE
640
 FCB 'F BYTE SEARCH
641
 FDB SEARCH
642
 FCB 'R REGISTER DUMP
643
 FDB PRINT
644
 FCB 'J JUMP
645
 FDB JUMP
646
 FCB 'C CLEAR SCREEN
647
 FDB CLEAR
648
 FCB 'D DISK BOOT
649
 FDB DISK
650
 FCB 'B BREAKPOINT
651
 FDB BREAK
652
 FCB 'O OPTIONAL PORT
653
 FDB OPTL
654
TABLE1 FCB 'P ASCII PUNCH
655
 FDB PUNCH1
656
 FCB 'L ASCII LOAD
657
 FDB LOAD
658
TABEND FCB 'E END OF TAPE
659
 FDB PNCHS9
660
*
661
 ORG $E3F8
662
 FDB IRQV IRQ VECTOR
663
 FDB SFE SOFTWARE INTERRUPT
664
 FDB NMIV NMI VECTOR
665
 FDB START RESTART VECTOR
666
*
667
 ORG $A048
668
 FDB START
669
 END

powered by: WebSVN 2.1.0

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