Browse Source

added DOS_1571CR

master
Michael Steil 1 month ago
parent
commit
5555684ac2
100 changed files with 20244 additions and 0 deletions
  1. 104
    0
      DOS_1571CR/addfil.src
  2. 178
    0
      DOS_1571CR/addrel.src
  3. 443
    0
      DOS_1571CR/block.src
  4. 109
    0
      DOS_1571CR/burstcr.src
  5. 221
    0
      DOS_1571CR/close.src
  6. 60
    0
      DOS_1571CR/com.src
  7. 104
    0
      DOS_1571CR/copall.src
  8. 80
    0
      DOS_1571CR/copset.src
  9. 308
    0
      DOS_1571CR/dskintsf.src
  10. 36
    0
      DOS_1571CR/duplct.src
  11. 70
    0
      DOS_1571CR/duplct1.src
  12. 439
    0
      DOS_1571CR/erproccr.src
  13. 309
    0
      DOS_1571CR/fastld.src
  14. 1362
    0
      DOS_1571CR/fastutl.src
  15. 185
    0
      DOS_1571CR/fndrel.src
  16. 379
    0
      DOS_1571CR/frets.src
  17. 248
    0
      DOS_1571CR/gcrcntrl.src
  18. 282
    0
      DOS_1571CR/gcrtable1.src
  19. 281
    0
      DOS_1571CR/gcrtable3.src
  20. 282
    0
      DOS_1571CR/gcrtable6.src
  21. 281
    0
      DOS_1571CR/gcrtable8.src
  22. 274
    0
      DOS_1571CR/gcrtables.src
  23. 90
    0
      DOS_1571CR/getact.src
  24. 138
    0
      DOS_1571CR/idlesf.src
  25. 33
    0
      DOS_1571CR/irq.src
  26. 55
    0
      DOS_1571CR/irq1541.src
  27. 46
    0
      DOS_1571CR/irq1571.src
  28. 360
    0
      DOS_1571CR/jobssf.src
  29. 258
    0
      DOS_1571CR/lccbingcr.src
  30. 219
    0
      DOS_1571CR/lcccntrl.src
  31. 58
    0
      DOS_1571CR/lccconhdr.src
  32. 232
    0
      DOS_1571CR/lccend.src
  33. 221
    0
      DOS_1571CR/lccfmt1.src
  34. 307
    0
      DOS_1571CR/lccfmt2.src
  35. 351
    0
      DOS_1571CR/lccfmt2a.src
  36. 106
    0
      DOS_1571CR/lccfmt3.src
  37. 89
    0
      DOS_1571CR/lccfmt3a.src
  38. 171
    0
      DOS_1571CR/lccfmt4.src
  39. 41
    0
      DOS_1571CR/lccfmt4a.src
  40. 287
    0
      DOS_1571CR/lccgcrbin.src
  41. 164
    0
      DOS_1571CR/lccgcrbn1.src
  42. 66
    0
      DOS_1571CR/lccinit.src
  43. 67
    0
      DOS_1571CR/lccio.src
  44. 138
    0
      DOS_1571CR/lccread.src
  45. 238
    0
      DOS_1571CR/lccread1.src
  46. 221
    0
      DOS_1571CR/lccseek.src
  47. 197
    0
      DOS_1571CR/lccseek1.src
  48. 58
    0
      DOS_1571CR/lccutil.src
  49. 209
    0
      DOS_1571CR/lccutil1.src
  50. 312
    0
      DOS_1571CR/lccwrt.src
  51. 287
    0
      DOS_1571CR/lccwrt1.src
  52. 51
    0
      DOS_1571CR/leds.src
  53. 409
    0
      DOS_1571CR/lookup.src
  54. 116
    0
      DOS_1571CR/lstdir.src
  55. 154
    0
      DOS_1571CR/m5710cr.src
  56. 37
    0
      DOS_1571CR/macroscr.src
  57. 133
    0
      DOS_1571CR/map.src
  58. 573
    0
      DOS_1571CR/mcntrlcr.src
  59. 62
    0
      DOS_1571CR/memrw.src
  60. 416
    0
      DOS_1571CR/msubr1cr.src
  61. 284
    0
      DOS_1571CR/msubr2cr.src
  62. 156
    0
      DOS_1571CR/msubr3cr.src
  63. 79
    0
      DOS_1571CR/msubrcr.src
  64. 122
    0
      DOS_1571CR/new.src
  65. 105
    0
      DOS_1571CR/newss.src
  66. 52
    0
      DOS_1571CR/newvec.src
  67. 46
    0
      DOS_1571CR/notescr.src
  68. 61
    0
      DOS_1571CR/nulbuf.src
  69. 425
    0
      DOS_1571CR/open.src
  70. 209
    0
      DOS_1571CR/opnchnl.src
  71. 285
    0
      DOS_1571CR/parsex.src
  72. 1458
    0
      DOS_1571CR/patchcr.src
  73. 144
    0
      DOS_1571CR/record.src
  74. 128
    0
      DOS_1571CR/rel1.src
  75. 148
    0
      DOS_1571CR/rel2.src
  76. 58
    0
      DOS_1571CR/rel3.src
  77. 84
    0
      DOS_1571CR/rel4.src
  78. 233
    0
      DOS_1571CR/rename.src
  79. 48
    0
      DOS_1571CR/romsf.src
  80. 84
    0
      DOS_1571CR/romtblsf.src
  81. 77
    0
      DOS_1571CR/scrtch.src
  82. 132
    0
      DOS_1571CR/seratn.src
  83. 182
    0
      DOS_1571CR/seratn1.src
  84. 135
    0
      DOS_1571CR/serlibcr.src
  85. 145
    0
      DOS_1571CR/serlistn.src
  86. 116
    0
      DOS_1571CR/serlistn1.src
  87. 133
    0
      DOS_1571CR/sertalk.src
  88. 136
    0
      DOS_1571CR/sertalk1.src
  89. 125
    0
      DOS_1571CR/setdrv.src
  90. 82
    0
      DOS_1571CR/signature.src
  91. 47
    0
      DOS_1571CR/ssend.src
  92. 42
    0
      DOS_1571CR/sstest.src
  93. 189
    0
      DOS_1571CR/ssutil.src
  94. 12
    0
      DOS_1571CR/system.src
  95. 34
    0
      DOS_1571CR/titlecr.src
  96. 257
    0
      DOS_1571CR/trnsfr.src
  97. 570
    0
      DOS_1571CR/tst2cr.src
  98. 371
    0
      DOS_1571CR/tst3.src
  99. 245
    0
      DOS_1571CR/tst4.src
  100. 0
    0
      DOS_1571CR/tstflg.src

+ 104
- 0
DOS_1571CR/addfil.src View File

@@ -0,0 +1,104 @@
1
+        .page  
2
+        .subttl 'addfil.src'          
3
+; add file to directory
4
+
5
+addfil  lda  sa         ; save variables 
6
+        pha      
7
+        lda  lindx       
8
+        pha      
9
+        lda  sector      
10
+        pha      
11
+        lda  track       
12
+        pha      
13
+        lda  #irsa       
14
+        sta  sa          
15
+        jsr  curblk     ; use last accessed search
16
+        lda  type        
17
+        pha      
18
+        lda  fildrv      
19
+        and  #1          
20
+        sta  drvnum      
21
+        ldx  jobnum      
22
+        eor  lstjob,x    
23
+        lsr  a   
24
+        bcc  af08       ; same drive as required
25
+
26
+        ldx  #1          
27
+        stx  delind     ; look for deleted entry
28
+        jsr  srchst      
29
+        beq  af15       ; all full, new sector 
30
+        bne  af20       ; found one
31
+
32
+af08    lda  delsec      
33
+        beq  af10       ; deleted entry not located
34
+        cmp  sector      
35
+        beq  af20       ; sector is resident
36
+        sta  sector      
37
+        jsr  drtrd      ; read sector in
38
+        jmp  af20        
39
+
40
+af10    lda  #1         ; find deleted entry
41
+        sta  delind      
42
+        jsr  search      
43
+        bne  af20        
44
+af15    jsr  nxdrbk     ; all full, new sector
45
+        lda  sector      
46
+        sta  delsec      
47
+        lda  #2          
48
+        sta  delind      
49
+af20    lda  delind      
50
+        jsr  setpnt      
51
+        pla      
52
+        sta  type       ; set type
53
+        cmp  #reltyp     
54
+        bne  af25        
55
+        ora  #$80        
56
+af25             
57
+        jsr  putbyt      
58
+        pla      
59
+        sta  filtrk     ; ...table & entry
60
+        jsr  putbyt      
61
+        pla      
62
+        sta  filsec     ; set sector link in...
63
+        jsr  putbyt     ; ...table & entry
64
+        jsr  getact      
65
+        tay      
66
+        lda  filtbl      
67
+        tax      
68
+        lda  #16         
69
+        jsr  trname     ; transfer name
70
+        ldy  #16         
71
+        lda  #0         ; clear # of blocks &...
72
+af30    sta  (dirbuf),y ; ...& replace links
73
+        iny      
74
+        cpy  #27         
75
+        bcc  af30        
76
+        lda  type       ; a relative file ?
77
+        cmp  #reltyp     
78
+        bne  af50       ; no
79
+        ldy  #16        ; yes
80
+        lda  trkss      ; get ss track
81
+        sta  (dirbuf),y ; put in directory
82
+        iny      
83
+        lda  secss      ; get ss sector
84
+        sta  (dirbuf),y ; put in
85
+        iny      
86
+        lda  rec        ; get record size
87
+        sta  (dirbuf),y          
88
+af50    jsr  drtwrt     ; write it out
89
+        pla      
90
+        sta  lindx       
91
+        tax      
92
+        pla      
93
+        sta  sa          
94
+        lda  delsec      
95
+        sta  entsec      
96
+        sta  dsec,x      
97
+        lda  delind      
98
+        sta  entind      
99
+        sta  dind,x      
100
+        lda  type        
101
+        sta  pattyp      
102
+        lda  drvnum      
103
+        sta  fildrv      
104
+        rts      

+ 178
- 0
DOS_1571CR/addrel.src View File

@@ -0,0 +1,178 @@
1
+        .page
2
+        .subttl 'addrel.src'          
3
+;*********************************
4
+;* addrel: add blocks to relative*
5
+;*         file.                 *
6
+;*   vars:                       *
7
+;*   regs:                       *
8
+;*                               *
9
+;*********************************
10
+
11
+addrel           
12
+        jsr  setdrn      
13
+        jsr  ssend      ; set up end of file
14
+        jsr  posbuf      
15
+        jsr  dbset       
16
+        lda  ssind       
17
+        sta  r1         ; save ss index
18
+        lda  ssnum       
19
+        sta  r0         ; save ss number
20
+        lda  #0          
21
+        sta  r2         ; clear flag for one block
22
+
23
+        lda  #0         ; clear for calculation...
24
+        sta  recptr     ; ...to 1st byte in record
25
+        jsr  fndrel     ; calc ss ptrs
26
+addr1           	;  entry for rel record fix
27
+        jsr  numfre     ; calc available...
28
+
29
+        ldy  lindx      ; record span?
30
+        ldx  rs,y        
31
+        dex      
32
+        txa      
33
+        clc      
34
+        adc  relptr      
35
+        bcc  ar10       ; no span
36
+
37
+        inc  ssind      ; inc ss ptrs & check
38
+        inc  ssind      ; inc ss ptrs & check
39
+        bne  ar10        
40
+        inc  ssnum       
41
+        lda  #ssioff     
42
+        sta  ssind       
43
+ar10             
44
+        lda  r1          
45
+        clc      
46
+        adc  #2          
47
+        jsr  setssp      
48
+
49
+        lda  ssnum       
50
+        cmp  #nssl       
51
+        bcc  ar25       ; valid range
52
+
53
+ar20             
54
+        lda  #bigfil     
55
+        jsr  cmderr     ; too many ss's
56
+ar25             
57
+        lda  ssind      ; calc # blocks needed...
58
+        sec     	; ...& check against avail.
59
+        sbc  r1          
60
+        bcs  ar30        
61
+        sbc  #ssioff-1   
62
+        clc      
63
+ar30             
64
+        sta  t3         ; # ss indices
65
+        lda  ssnum       
66
+        sbc  r0          
67
+        sta  t4         ; # ss needed
68
+
69
+        ldx  #0         ; clear accum.
70
+        stx  t1          
71
+        stx  t2          
72
+        tax     	; .x=# ss
73
+        jsr  sscalc     ; calc # of blocks needed
74
+
75
+        lda  t2          
76
+        bne  ar35        
77
+        ldx  t1          
78
+        dex      
79
+        bne  ar35        
80
+
81
+        inc  r2          
82
+ar35             
83
+        cmp  nbtemp+1    
84
+        bcc  ar40       ; ok!!
85
+        bne  ar20        
86
+        lda  nbtemp      
87
+        cmp  t1          
88
+        bcc  ar20       ; not enuf blocks
89
+ar40             
90
+        lda  #1          
91
+        jsr  drdbyt     ; look at sector link
92
+        clc      
93
+        adc  #1         ; +1 is nr
94
+        ldx  lindx       
95
+        sta  nr,x        
96
+        jsr  nxtts      ; get next block...
97
+        jsr  setlnk     ; ...& set link.
98
+        lda  r2          
99
+        bne  ar50       ; add one block
100
+
101
+        jsr  wrtout     ; write current last rec
102
+ar45             
103
+        jsr  dblbuf     ; switch bufs
104
+        jsr  sethdr     ; set hdr from t & s
105
+        jsr  nxtts      ; get another
106
+        jsr  setlnk     ; set up link
107
+        jsr  nulbuf     ; clean it out
108
+        jmp  ar55        
109
+ar50             
110
+        jsr  dblbuf     ; switch bufs
111
+        jsr  sethdr     ; set hdr from t & s
112
+        jsr  nulbuf     ; clean buffer
113
+        jsr  nullnk     ; last block =0,lstchr
114
+ar55             
115
+        jsr  wrtout     ; write buffer
116
+        jsr  getlnk     ; get t&s from link
117
+        lda  track       
118
+        pha     	; save 'em
119
+        lda  sector      
120
+        pha      
121
+        jsr  gethdr     ; now get hdr t&s
122
+        lda  sector      
123
+        pha     	; save 'em
124
+        lda  track       
125
+        pha      
126
+        jsr  gsspnt     ; check ss ptr
127
+        tax      
128
+        bne  ar60        
129
+
130
+        jsr  newss      ; need another ss
131
+        lda  #ssioff     
132
+        jsr  setssp     ; .a=bt val
133
+        inc  r0         ; advance ss count
134
+ar60             
135
+        pla      
136
+        jsr  putss      ; record t&s...
137
+        pla      
138
+        jsr  putss      ; ...in ss.
139
+        pla     	; get t&s from link
140
+        sta  sector      
141
+        pla      
142
+        sta  track       
143
+        beq  ar65       ; t=0: that's all!!
144
+
145
+        lda  r0          
146
+        cmp  ssnum       
147
+        bne  ar45       ; not even done yet
148
+
149
+        jsr  gsspnt      
150
+        cmp  ssind       
151
+        bcc  ar45       ; almost done
152
+        beq  ar50       ; one more block left
153
+ar65             
154
+        jsr  gsspnt      
155
+        pha      
156
+        lda  #0          
157
+        jsr  ssdir       
158
+        lda  #0          
159
+        tay      
160
+        sta  (dirbuf),y          
161
+        iny      
162
+        pla      
163
+        sec      
164
+        sbc  #1          
165
+        sta  (dirbuf),y          
166
+        jsr  wrtss      ; write ss
167
+        jsr  watjob      
168
+        jsr  mapout      
169
+        jsr  fndrel      
170
+        jsr  dblbuf     ; get back to leading buffer
171
+        jsr  sspos       
172
+        bvs  ar70        
173
+        jmp  positn      
174
+ar70             
175
+        lda  #lrf        
176
+        jsr  setflg      
177
+        lda  #norec      
178
+        jsr  cmderr      

+ 443
- 0
DOS_1571CR/block.src View File

@@ -0,0 +1,443 @@
1
+        .page  
2
+        .subttl 'block.src'
3
+
4
+; rom 1.1 additions
5
+; user commands
6
+
7
+user    ldy  cmdbuf+1    
8
+        cpy  #'0         
9
+        bne  us10       ; 0 resets pntr
10
+
11
+usrint  jmp  burst_routines
12
+	nop		; fill
13
+	nop		; fill
14
+	nop		; fill
15
+	nop		; fill
16
+	nop		; fill
17
+	nop		; fill
18
+
19
+;       lda  #<ublock   ; set default block add
20
+;       sta  usrjmp      
21
+;       lda  #>ublock    
22
+;       sta  usrjmp+1    
23
+;       rts      
24
+
25
+us10    jsr  usrexc     ; execute code by table
26
+        jmp  endcmd      
27
+
28
+usrexc  dey     	; entry is(((index-1)and$f)*2)
29
+        tya      
30
+        and  #$f         
31
+        asl  a   
32
+        tay      
33
+
34
+	lda  (usrjmp),y          
35
+        sta  ip          
36
+        iny      
37
+        lda  (usrjmp),y          
38
+        sta  ip+1        
39
+
40
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
41
+
42
+	jmp  ptch53	; *** rom ds 05/21/85 ***
43
+;       jmp  (ip)        
44
+
45
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
46
+        .page  
47
+;  open direct access buffer
48
+;  from open "#"
49
+
50
+opnblk  lda  lstdrv      
51
+        sta  drvnum      
52
+        lda  sa         ; sa is destroyed by this patch
53
+        pha      
54
+        jsr  autoi      ; init disk for proper channel assignment
55
+        pla     	; restore sa
56
+        sta  sa          
57
+        ldx  cmdsiz      
58
+        dex      
59
+        bne  ob10        
60
+
61
+        lda  #1         ; get any buffer
62
+        jsr  getrch      
63
+        jmp  ob30        
64
+
65
+ob05    lda  #nochnl     
66
+        jmp  cmderr      
67
+
68
+ob10    ldy  #1         ; buffer # is requested
69
+        jsr  bp05        
70
+        ldx  filsec      
71
+        cpx  #bfcnt     ; must be less than 6.
72
+        bcs  ob05        
73
+
74
+        lda  #0          
75
+        sta  temp        
76
+        sta  temp+1      
77
+        sec      
78
+
79
+ob15             
80
+        rol  temp        
81
+        rol  temp+1      
82
+        dex      
83
+        bpl  ob15        
84
+
85
+        lda  temp        
86
+        and  bufuse      
87
+        bne  ob05       ; buffer is used
88
+        lda  temp+1      
89
+        and  bufuse+1    
90
+        bne  ob05       ; buf is used
91
+
92
+        lda  temp        
93
+        ora  bufuse     ; set buffer as used
94
+        sta  bufuse      
95
+        lda  temp+1      
96
+        ora  bufuse+1    
97
+        sta  bufuse+1    
98
+
99
+        lda  #0         ; set up channel
100
+        jsr  getrch      
101
+        ldx  lindx       
102
+        lda  filsec      
103
+        sta  buf0,x      
104
+        tax      
105
+        lda  drvnum      
106
+        sta  jobs,x      
107
+        sta  lstjob,x    
108
+
109
+ob30    ldx  sa          
110
+        lda  lintab,x   ; set lindx table
111
+        ora  #$40        
112
+        sta  lintab,x    
113
+
114
+        ldy  lindx       
115
+        lda  #$ff        
116
+        sta  lstchr,y    
117
+
118
+        lda  #rndrdy     
119
+        sta  chnrdy,y   ; set channel ready
120
+
121
+        lda  buf0,y      
122
+        sta  chndat,y   ; buffer # as 1st char
123
+        asl  a   
124
+        tax      
125
+        lda  #1          
126
+        sta  buftab,x    
127
+        lda  #dirtyp+dirtyp      
128
+        sta  filtyp,y   ; set direct file type
129
+        jmp  endcmd      
130
+        .page    
131
+
132
+; block commands
133
+
134
+block   ldy  #0          
135
+        ldx  #0          
136
+        lda  #'-        ; "-" separates cmd from subcmd
137
+        jsr  parse      ; locate sub-cmd
138
+        bne  blk40       
139
+
140
+blk10   lda  #badcmd     
141
+        jmp  cmderr      
142
+
143
+blk30   lda  #badsyn     
144
+        jmp  cmderr      
145
+
146
+blk40   txa      
147
+        bne  blk30       
148
+
149
+        ldx  #nbcmds-1	; find command
150
+        lda  cmdbuf,y    
151
+blk50   cmp  bctab,x     
152
+        beq  blk60       
153
+        dex      
154
+        bpl  blk50       
155
+        bmi  blk10       
156
+
157
+blk60            
158
+        txa      
159
+        ora  #$80        
160
+        sta  cmdnum      
161
+        jsr  blkpar     ; parse parms
162
+
163
+        lda  cmdnum      
164
+        asl  a   
165
+        tax      
166
+        lda  bcjmp+1,x   
167
+        sta  temp+1      
168
+        lda  bcjmp,x     
169
+        sta  temp        
170
+
171
+        jmp  (temp)     ; goto command
172
+
173
+bctab    .byte  'AFRWEP'         
174
+nbcmds   =*-bctab        
175
+
176
+bcjmp    .word blkalc   ; block-allocate
177
+	 .word blkfre	; block-free
178
+	 .word blkrd    ; block-read
179
+	 .word blkwt    ; block-write
180
+	 .word blkexc   ; block-execute
181
+	 .word blkptr   ; block-pointer
182
+
183
+blkpar  ldy  #0         ; parse block parms
184
+        ldx  #0          
185
+        lda  #':         
186
+        jsr  parse       
187
+        bne  bp05       ; found ":"
188
+
189
+        ldy  #3         ; else char #3 is beginning
190
+bp05    lda  cmdbuf,y    
191
+        cmp  #'          
192
+        beq  bp10        
193
+
194
+        cmp  #29        ; skip character
195
+        beq  bp10        
196
+
197
+        cmp  #',         
198
+        bne  bp20        
199
+
200
+bp10    iny      
201
+        cpy  cmdsiz      
202
+        bcc  bp05        
203
+
204
+        rts     	; that's all
205
+
206
+bp20    jsr  aschex      
207
+        inc  f1cnt       
208
+        ldy  f2ptr       
209
+        cpx  #mxfils-1   
210
+        bcc  bp10        
211
+
212
+        bcs  blk30      ; bad syntax
213
+
214
+;  convert ascii to hex (binary)
215
+;  & store conversion in tables
216
+;  .y= ptr into cmdbuf
217
+aschex  lda  #0          
218
+        sta  temp        
219
+        sta  temp+1      
220
+        sta  temp+3      
221
+
222
+        ldx  #$ff        
223
+ah10    lda  cmdbuf,y   ; test for dec #
224
+        cmp  #$40        
225
+        bcs  ah20       ; non-numeric terminates
226
+        cmp  #$30        
227
+        bcc  ah20       ; non-numeric
228
+
229
+        and  #$f         
230
+        pha      
231
+        lda  temp+1     ; shift digits (*10)
232
+        sta  temp+2      
233
+        lda  temp        
234
+        sta  temp+1      
235
+        pla      
236
+        sta  temp        
237
+        iny      
238
+        cpy  cmdsiz      
239
+        bcc  ah10       ; still in string
240
+
241
+ah20    sty  f2ptr      ; convert digits to...
242
+        clc     	; ...binary by dec table
243
+        lda  #0          
244
+
245
+ah30    inx      
246
+        cpx  #3          
247
+        bcs  ah40        
248
+
249
+        ldy  temp,x      
250
+ah35    dey      
251
+        bmi  ah30        
252
+
253
+        adc  dectab,x    
254
+        bcc  ah35        
255
+
256
+        clc      
257
+        inc  temp+3      
258
+        bne  ah35        
259
+
260
+ah40    pha      
261
+        ldx  f1cnt       
262
+        lda  temp+3      
263
+        sta  filtrk,x   ; store result in table
264
+        pla      
265
+        sta  filsec,x    
266
+        rts      
267
+
268
+dectab   .byte 1,10,100 ; decimal table
269
+
270
+;block-free
271
+blkfre  jsr  blktst      
272
+        jsr  frets       
273
+        jmp  endcmd      
274
+
275
+;block-allocate
276
+
277
+        lda  #1          
278
+        sta  wbam        
279
+blkalc           
280
+        jsr  blktst      
281
+
282
+ba10             
283
+        lda  sector      
284
+        pha      
285
+        jsr  getsec      
286
+        beq  ba15       ; none greater on this track
287
+        pla      
288
+        cmp  sector      
289
+        bne  ba30       ; requested sector not avail
290
+        jsr  wused       
291
+        jmp  endcmd      
292
+
293
+ba15             
294
+        pla     	; pop stack
295
+ba20             
296
+        lda  #0          
297
+        sta  sector      
298
+        inc  track       
299
+        lda  track       
300
+        cmp  maxtrk      
301
+        bcs  ba40       ; gone all the way
302
+
303
+        jsr  getsec      
304
+        beq  ba20        
305
+ba30             
306
+        lda  #noblk      
307
+        jsr  cmder2      
308
+ba40             
309
+        lda  #noblk      
310
+        jsr  cmderr     ; t=0,s=0 :none left
311
+
312
+
313
+; block read subs
314
+blkrd2  jsr  bkotst     ; test parms
315
+        jmp  drtrd       
316
+
317
+getsim  jsr  getpre     ; get byte w/o inc
318
+        lda  (buftab,x)          
319
+        rts      
320
+
321
+; block read
322
+blkrd3  jsr  blkrd2      
323
+        lda  #0          
324
+        jsr  setpnt      
325
+        jsr  getsim     ; y=lindx
326
+ 
327
+
328
+        sta  lstchr,y    
329
+        lda  #rndrdy     
330
+        sta  chnrdy,y    
331
+        rts      
332
+blkrd            
333
+        jsr  blkrd3      
334
+        jsr  rnget1      
335
+        jmp  endcmd      
336
+
337
+;user direct read, lstchr=$ff
338
+ublkrd           
339
+        jsr  blkpar      
340
+        jsr  blkrd3      
341
+        lda  lstchr,y    
342
+        sta  chndat,y    
343
+        lda  #$ff        
344
+        sta  lstchr,y    
345
+        jmp  endcmd     ; (rts)
346
+
347
+;block-write
348
+blkwt   jsr  bkotst      
349
+
350
+        jsr  getpnt      
351
+        tay      
352
+        dey      
353
+        cmp  #2          
354
+        bcs  bw10        
355
+        ldy  #1          
356
+
357
+bw10    lda  #0         ; set record size
358
+        jsr  setpnt      
359
+        tya      
360
+        jsr  putbyt      
361
+        txa      
362
+        pha      
363
+
364
+bw20    jsr  drtwrt     ; write block
365
+        pla      
366
+        tax      
367
+
368
+;       jsr  rnget2      
369
+	jsr  ptch15	; fix for block read *rom ds 01/22/85* 
370
+
371
+        jmp  endcmd      
372
+
373
+;user dirct write, no lstchr
374
+ublkwt  jsr  blkpar      
375
+        jsr  bkotst      
376
+        jsr  drtwrt      
377
+        jmp  endcmd      
378
+
379
+;block-execute
380
+blkexc           
381
+        jsr  killp      ; kill protect
382
+        jsr  blkrd2     ; read block & execute
383
+        lda  #0          
384
+
385
+be05    sta  temp        
386
+        ldx  jobnum      
387
+        lda  bufind,x    
388
+        sta  temp+1      
389
+        jsr  be10       ; indirect jsr
390
+        jmp  endcmd      
391
+
392
+be10    jmp  (temp)      
393
+
394
+;buffer-pointer, set buffer pointer 
395
+blkptr  jsr  buftst      
396
+        lda  jobnum      
397
+        asl  a   
398
+        tax      
399
+        lda  filsec+1    
400
+        sta  buftab,x    
401
+        jsr  getpre      
402
+        jsr  rnget2     ; set up get
403
+        jmp  endcmd      
404
+
405
+;test for allocated buffer..
406
+;  ..related to sa
407
+buftst  ldx  f1ptr       
408
+        inc  f1ptr       
409
+        lda  filsec,x    
410
+        tay      
411
+        dey      
412
+        dey      
413
+        cpy  #$c        ;  set limit to # of sas 
414
+        bcc  bt20        
415
+
416
+bt15    lda  #nochnl     
417
+        jmp  cmderr      
418
+
419
+bt20    sta  sa          
420
+        jsr  fndrch      
421
+        bcs  bt15        
422
+        jsr  getact      
423
+        sta  jobnum      
424
+        rts      
425
+
426
+;test block operation parms
427
+bkotst  jsr  buftst      
428
+;
429
+;test for legal block &..
430
+;  ..set up drv, trk, sec
431
+blktst  ldx  f1ptr       
432
+        lda  filsec,x    
433
+        and  #1          
434
+        sta  drvnum      
435
+        lda  filsec+2,x          
436
+        sta  sector      
437
+        lda  filsec+1,x          
438
+        sta  track       
439
+bt05             
440
+        jsr  tschk       
441
+        jmp  setlds     ; (rts)
442
+
443
+; rsr 1/19/80 add autoi to #cmd

+ 109
- 0
DOS_1571CR/burstcr.src View File

@@ -0,0 +1,109 @@
1
+        .page
2
+	.subttl 'burst'
3
+	*=$8000
4
+
5
+signature_lo *=*+1	; <<<< TO BE DETERMINED
6
+signature_hi *=*+1	; <<<< TO BE DETERMINED
7
+
8
+
9
+	.byte  'S/W BY DAVID G SIRACUSA',$0D,"5710 BY C. HAUCK",$0D,'1986',$0D
10
+
11
+burst_routines
12
+
13
+	lda  cmdsiz     ; check command size
14
+	cmp  #3
15
+	bcc  realus
16
+
17
+	lda  cmdbuf+2	; get command
18
+	sta  switch	; save info
19
+	and  #$1f
20
+	tax		; command info
21
+	asl  a
22
+	tay
23
+	lda  cmdtbb,y
24
+	sta  ip
25
+	lda  cmdtbb+1,y
26
+	sta  ip+1
27
+	cpx  #30	; utload ok for 1541 mode
28
+	beq  1$
29
+
30
+	lda  pota1
31
+	and  #$20	; 1/2 Mhz ?
32
+	beq  realus	; 1541 mode...ignore
33
+
34
+1$	lda  fastsr	; clear clock & error return
35
+	and  #$eb
36
+	sta  fastsr
37
+
38
+	lda  cmdctl,x   ; most sig bit set set error recover
39
+	sta  cmdbuf+2	; save info here
40
+
41
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
42
+
43
+	jmp  ptch65	
44
+;	jmp  (ip)	; *** rom ds 04/25/86 ***
45
+
46
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
47
+
48
+realus  lda  #<ublock   ; set default block add
49
+        sta  usrjmp      
50
+        lda  #>ublock    
51
+        sta  usrjmp+1    
52
+unused  rts      
53
+
54
+	.page
55
+
56
+; command tables and information
57
+
58
+cmdctl   .byte  $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$01
59
+         .byte  $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$80
60
+
61
+cmdtbb   .word    fstrd  	 ; fast read drv #0 - 0000
62
+	 .word    ndkrd 	 ; fast read drv #1 - 0001
63
+
64
+	 .word    fstwrt         ; fast write drv #0 - 0010
65
+	 .word    ndkwrt	 ; fast write drv #1 - 0011
66
+
67
+         .word    fstsek         ; seek disk drv #0 - 0100
68
+         .word    ndkrd          ; seek disk drv #1 - 0101
69
+
70
+         .word    fstfmt         ; format disk drv #0 - 0110
71
+         .word    fstfmt         ; format disk drv #1 - 0111
72
+
73
+         .word    cpmint	 ; interleave disk drv #0 - 1000
74
+         .word    cpmint	 ; interleave disk drv #1 - 1001
75
+
76
+	 .word    querdk	 ; query disk format - 1010
77
+         .word    ndkrd          ; seek disk drv #1 - 1011
78
+
79
+	 .word    inqst		 ; return disk status - 1100
80
+	 .word    ndkrd		 ; return disk status - 1101
81
+
82
+	 .word    duplc1	 ; backup drv0 to drv1 - 1110
83
+	 .word    duplc1	 ; backup drv1 to drv0 - 1111
84
+
85
+; *****************************************************************
86
+	
87
+	 .word    fstrd  	 ; fast read drv #0 - 0000
88
+	 .word    ndkrd 	 ; fast read drv #1 - 0001
89
+
90
+	 .word    fstwrt         ; fast write drv #0 - 0010
91
+	 .word    ndkwrt	 ; fast write drv #1 - 0011
92
+
93
+         .word    fstsek         ; seek disk drv #0 - 0100
94
+         .word    ndkrd          ; seek disk drv #1 - 0101
95
+
96
+         .word    fstfmt
97
+         .word    fstfmt
98
+
99
+         .word    unused
100
+         .word    unused
101
+
102
+	 .word    querdk	 ; query disk format - 1010
103
+         .word    ndkrd          ; seek disk drv #1 - 1011
104
+
105
+         .word    unused
106
+         .word    unused
107
+
108
+         .word    chgutl
109
+         .word    fstload

+ 221
- 0
DOS_1571CR/close.src View File

@@ -0,0 +1,221 @@
1
+        .page 
2
+        .subttl 'close.src'   
3
+; close the file associated with sa
4
+
5
+close            
6
+        lda  #0          
7
+        sta  wbam        
8
+        lda  sa          
9
+        bne  cls10      ; directory close
10
+        lda  #0          
11
+        sta  dirlst     ; clear dir list
12
+        jsr  frechn      
13
+cls05            
14
+        jmp  freich      
15
+cls10            
16
+        cmp  #$f         
17
+        beq  clsall     ; close cmd chanl
18
+        jsr  clschn     ; close channel
19
+        lda  sa          
20
+        cmp  #2          
21
+        bcc  cls05       
22
+
23
+        lda  erword      
24
+        bne  cls15      ; last command had an error
25
+        jmp  endcmd      
26
+cls15            
27
+        jmp  scren1      
28
+
29
+clsall           
30
+        lda  #14         
31
+        sta  sa          
32
+cls20            
33
+        jsr  clschn      
34
+        dec  sa          
35
+        bpl  cls20       
36
+        lda  erword      
37
+        bne  cls25      ;  last command had an error
38
+        jmp  endcmd      
39
+cls25            
40
+        jmp  scren1      
41
+
42
+clschn           
43
+        ldx  sa          
44
+        lda  lintab,x    
45
+        cmp  #$ff        
46
+        bne  clsc28      
47
+        rts      
48
+clsc28           
49
+        and  #$f         
50
+        sta  lindx       
51
+
52
+        jsr  typfil      
53
+        cmp  #dirtyp     
54
+        beq  clsc30     ; direct channel
55
+        cmp  #reltyp     
56
+        beq  clsrel      
57
+
58
+        jsr  fndwch     ; look for write channel
59
+        bcs  clsc31      
60
+
61
+        jsr  clswrt     ; close seq write
62
+        jsr  clsdir     ; close directory
63
+clsc30           
64
+        jsr  mapout     ; write bam
65
+clsc31           
66
+        jmp  frechn      
67
+
68
+clsrel           
69
+        jsr  scrub       
70
+        jsr  dblbuf      
71
+        jsr  ssend       
72
+        ldx  ssnum       
73
+        stx  t4          
74
+        inc  t4          
75
+        lda  #0          
76
+        sta  t1          
77
+        sta  t2          
78
+        lda  ssind       
79
+        sec      
80
+        sbc  #ssioff-2   
81
+        sta  t3          
82
+        jsr  sscalc      
83
+        ldx  lindx       
84
+        lda  t1          
85
+        sta  nbkl,x      
86
+        lda  t2          
87
+        sta  nbkh,x      
88
+        lda  #dyfile     
89
+        jsr  tstflg      
90
+        beq  clsr1       
91
+        jsr  clsdir      
92
+clsr1   jmp  frechn      
93
+
94
+; close a write chanl
95
+
96
+clswrt          	; close seq write file
97
+        ldx  lindx       
98
+        lda  nbkl,x      
99
+        ora  nbkh,x      
100
+        bne  clsw10     ; at least 1 block written
101
+
102
+        jsr  getpnt      
103
+        cmp  #2          
104
+        bne  clsw10     ; at least 1 byte written
105
+
106
+        lda  #cr         
107
+        jsr  putbyt      
108
+clsw10           
109
+        jsr  getpnt      
110
+        cmp  #2          
111
+        bne  clsw20     ; not mt buffer
112
+
113
+        jsr  dblbuf     ; switch bufs
114
+
115
+        ldx  lindx       
116
+        lda  nbkl,x      
117
+        bne  clsw15      
118
+        dec  nbkh,x      
119
+clsw15           
120
+        dec  nbkl,x      
121
+
122
+        lda  #0          
123
+clsw20           
124
+        sec      
125
+        sbc  #1         ; back up 1
126
+        pha     	; save it
127
+        lda  #0          
128
+        jsr  setpnt      
129
+        jsr  putbyt     ; tlink=0
130
+        pla     	; lstchr count
131
+        jsr  putbyt      
132
+
133
+        jsr  wrtbuf     ; write out last buffer
134
+        jsr  watjob     ; finish job up
135
+        jmp  dblbuf     ; make sure both bufs ok
136
+
137
+; directory close on open write file
138
+
139
+clsdir  ldx  lindx      ; save lindx
140
+        stx  wlindx     ; &sa
141
+        lda  sa          
142
+        pha      
143
+        lda  dsec,x     ; get directory sector
144
+        sta  sector      
145
+        lda  dind,x     ; get sector offset
146
+        sta  index       
147
+        lda  filtyp,x   ; drv # in filtyp
148
+        and  #1          
149
+        sta  drvnum      
150
+        lda  dirtrk      
151
+        sta  track       
152
+        jsr  getact     ; allocate a buffer
153
+        pha      
154
+        sta  jobnum      
155
+        jsr  drtrd      ; read directory sector
156
+        ldy  #0          
157
+        lda  bufind,x   ; .x is job#
158
+        sta  r0+1        
159
+        lda  index       
160
+        sta  r0          
161
+        lda  (r0),y      
162
+        and  #$20        
163
+        beq  clsd5       
164
+        jsr  typfil      
165
+        cmp  #reltyp     
166
+        beq  clsd6       
167
+
168
+        lda  (r0),y      
169
+        and  #$8f       ; replace file
170
+        sta  (r0),y      
171
+        iny      
172
+        lda  (r0),y      
173
+        sta  track       
174
+        sty  temp+2      
175
+        ldy  #27        ; extract replacement link
176
+        lda  (r0),y     ;  to last sector
177
+        pha      
178
+        dey      
179
+        lda  (r0),y      
180
+        bne  clsd4       
181
+        sta  track       
182
+        pla      
183
+        sta  sector      
184
+        lda  #$67        
185
+        jsr  cmder2      
186
+clsd4            
187
+        pha      
188
+        lda  #0          
189
+        sta  (r0),y      
190
+        iny      
191
+        sta  (r0),y      
192
+        pla      
193
+        ldy  temp+2      
194
+        sta  (r0),y      
195
+        iny      
196
+        lda  (r0),y      
197
+        sta  sector      
198
+        pla      
199
+        sta  (r0),y      
200
+        jsr  delfil     ; delete old file
201
+        jmp  clsd6      ; set close bit
202
+clsd5            
203
+        lda  (r0),y      
204
+        and  #$f         
205
+        ora  #$80        
206
+        sta  (r0),y      
207
+clsd6   ldx  wlindx      
208
+        ldy  #28        ; set # of blocks
209
+        lda  nbkl,x      
210
+        sta  (r0),y      
211
+        iny      
212
+        lda  nbkh,x      
213
+        sta  (r0),y      
214
+        pla      
215
+        tax      
216
+        lda  #write     ; write directory sector
217
+        ora  drvnum      
218
+        jsr  doit        
219
+        pla      
220
+        sta  sa          
221
+        jmp  fndwch     ; restore lindx

+ 60
- 0
DOS_1571CR/com.src View File

@@ -0,0 +1,60 @@
1
+	.SUBTTL 'COM.SRC'
2
+	.PAGE
3
+;**********************************************
4
+;*                                            *
5
+;*   COMMODORE BUSINESS MACHINES SOFTWARE     *
6
+;*                                            *
7
+;**********************************************
8
+;*                                            *
9
+;*    11     55555    77777     11            *
10
+;*     1     5           7       1            *
11
+;*     1     5555       7        1            *
12
+;*     1         5      7        1            *
13
+;*   11111   5555       7      11111          *
14
+;*                                            *
15
+;*    FFFFFF   AAAAAA   SSSSSS   TTTTTT       *
16
+;*    F        A    A   S          T          *
17
+;*    FFFF     AAAAAA   SSSSSS     T          *
18
+;*    F        A    A        S     T          *
19
+;*    F        A    A   SSSSSS     T          *
20
+;*                                            *
21
+;*  SSSSS  EEEEE  RRRRR  IIIII  AAAAA  L      *
22
+;*  S      E      R   R    I    A   A  L      *
23
+;*  SSSSS  EEEE   RRR      I    AAAAA  L      *
24
+;*      S  E      R  R     I    A   A  L      *
25
+;*  SSSSS  EEEEE  R   R  IIIII. A   A  LLLLL  *
26
+;*                                            *
27
+;*  DDDD   IIIII  SSSSS  K    K		      *
28
+;*  D   D    I    S      K   K  	      *
29
+;*  D   D    I    SSSSS  KKK		      *
30
+;*  D   D    I        S  K   K  	      *
31
+;*  DDDD   IIIII  SSSSS  K    K  	      *
32
+;*                                            *
33
+;*                                            *
34
+;**********************************************
35
+;*                                            *
36
+;*   DISK OPERATING SYSTEM AND CONTROLLER     *
37
+;*   ROUTINES.                                *
38
+;*                                            *
39
+;*   COPYRIGHT (C) 1986 BY                    *
40
+;*   COMMODORE BUSINESS MACHINES (CBM)        *
41
+;*                                            *
42
+;*   					DS    *
43
+;*                                            *
44
+;**********************************************
45
+;
46
+;**********************************************
47
+;*   THIS SOFTWARE IS FURNISHED FOR USE IN    *
48
+;*  THE 1571 FAST SERIAL FLOPPY DISK DRIVE.   *
49
+;*                                            *
50
+;*   COPIES THEREOF MAY NOT BE PROVIDED OR    *
51
+;*  MADE AVAILABLE FOR USE ON ANY OTHER       *
52
+;*  SYSTEM.                                   *
53
+;*                                            *
54
+;*   THE INFORMATION IN THIS DOCUMENT IS      *
55
+;*  SUBJECT TO CHANGE WITHOUT NOTICE.         *
56
+;*                                            *
57
+;*   NO RESPONSIBILITY IS ASSUMED FOR         *
58
+;*  RELIABILITY OF THIS SOFTWARE.             *
59
+;*                                            *
60
+;**********************************************

+ 104
- 0
DOS_1571CR/copall.src View File

@@ -0,0 +1,104 @@
1
+	.page   
2
+	.subttl 'copall.src'
3
+
4
+; set up subroutine
5
+
6
+pups1   lda  #0          
7
+        sta  rec         
8
+        sta  drvcnt      
9
+        sta  filtrk      
10
+        sta  filtrk+1    
11
+        lda  fildrv+1   ; get drive number
12
+        and  #1         ; only
13
+        sta  drvnum      
14
+        ora  #1          
15
+        sta  delsec     ; nonzero
16
+        lda  filtbl+1   ; fn1=fn2
17
+        sta  filtbl      
18
+        rts      
19
+	.nlist
20
+;.end
21
+	.page   'copy  all'     
22
+;
23
+; copy disk to disk routines
24
+;
25
+;cpydtd  lda  filtbl+1   ; save in temp
26
+;        sta  temp        
27
+;        ldy  #40        ; 40 char buffer
28
+;        ldx  cmdsiz     ; prep to move
29
+;        sty  cmdsiz     ; end of filename2
30
+;movlp1  dey      
31
+;        dex      
32
+;        lda  cmdbuf,x   ; mov fn lifo
33
+;        sta  cmdbuf,y    
34
+;        cpx  temp       ; actual f2 val
35
+;        bne  movlp1      
36
+;        sty  filtbl+1   ; pointer to f2
37
+;movlp2  jsr  optsch      
38
+;        jsr  pups1      ; setup first pass
39
+;        jsr  ffst       ; first match
40
+;        bpl  fixit      ; entry found?
41
+;        bmi  endit      ; no
42
+;;
43
+;exlp0   pla     ; pull needed vars
44
+;        sta  dirsec      
45
+;        pla      
46
+;        sta  filtbl+1    
47
+;        pla      
48
+;        sta  lstbuf      
49
+;        pla      
50
+;        sta  filcnt      
51
+;        pla      
52
+;        sta  index       
53
+;        pla      
54
+;        sta  found       
55
+;        pla      
56
+;        sta  delind      
57
+;        pla      
58
+;        sta  drvflg      
59
+;;
60
+;exlp1   jsr  pups1      ; set up vars
61
+;        jsr  ffre       ; next match
62
+;        bpl  fixit      ; found one?
63
+;endit   jmp  endcmd     ; no! so bye
64
+;;
65
+;fixit   lda  drvflg     ; push needed vars
66
+;        pha      
67
+;        lda  delind      
68
+;        pha      
69
+;        lda  found       
70
+;        pha      
71
+;        lda  index       
72
+;        pha      
73
+;        lda  filcnt      
74
+;        pha      
75
+;        lda  lstbuf      
76
+;        pha      
77
+;        lda  filtbl+1    
78
+;        pha      
79
+;        lda  dirsec      
80
+;        pha      
81
+;;
82
+;exlp2   jsr  trfnme     ; transfer name
83
+;        lda  #1         ; fake out lookup
84
+;        sta  f1cnt       
85
+;        sta  f2cnt       
86
+;        jsr  lookup      
87
+;        lda  #1          
88
+;        sta  f1cnt       
89
+;        lda  #2         ; real
90
+;        sta  f2cnt       
91
+;        jsr  cy         ; copy it
92
+;        jmp  exlp0      ; next one folks
93
+;;
94
+;; transfer name (dirbuf) to cmdbuf
95
+;;
96
+;trfnme  ldy  #3         ; both indexes
97
+;        sty  filtbl     ; begining of filename1
98
+;trf0    lda  (dirbuf),y         ; move it
99
+;        sta  cmdbuf,y    
100
+;        iny      
101
+;        cpy  #19        ; all 16 chars passed?
102
+;        bne  trf0        
103
+;        rts      
104
+	.list

+ 80
- 0
DOS_1571CR/copset.src View File

@@ -0,0 +1,80 @@
1
+	.page  
2
+	.subttl 'copset.src'
3
+
4
+; dskcpy check for type
5
+; and parses special case
6
+
7
+dskcpy           
8
+        lda  #$e0       ; kill bam buffer
9
+        sta  bufuse      
10
+        jsr  clnbam     ; clr tbam
11
+        jsr  bam2x      ; get bam lindx in .x
12
+        lda  #$ff        
13
+        sta  buf0,x     ; mark bam out-of-memory
14
+        lda  #$0f        
15
+        sta  linuse     ; free all lindxs
16
+        jsr  prscln     ; find ":"
17
+        bne  dx0000      
18
+        jmp  duplct     ; bad command error, cx=x not allowed
19
+	.nlist
20
+;
21
+;jsr prseq
22
+;
23
+;lda #'* ;cpy all
24
+;ldx #39 ;put at buffer end
25
+;stx filtbl+1
26
+;sta cmdbuf,x ;place *
27
+;inx
28
+;stx cmdsiz
29
+;ldx #1 ;set up cnt's
30
+;stx f1cnt
31
+;inx
32
+;stx f2cnt
33
+;jmp movlp2 ;enter routine
34
+;
35
+	.list
36
+dx0000  jsr  tc30       ; normal parse
37
+dx0005  jsr  alldrs     ; put drv's in filtbl
38
+        lda  image      ; get parse image
39
+        and  #%01010101 ; val for patt copy
40
+        bne  dx0020     ; must be concat or normal
41
+        ldx  filtbl     ; chk for *
42
+        lda  cmdbuf,x    
43
+        cmp  #'*         
44
+        bne  dx0020      
45
+	.nlist
46
+;ldx #1 ;set cnt's
47
+;  no pattern matching allowed
48
+;stx f1cnt
49
+;inx
50
+;stx f2cnt
51
+;jmp cpydtd ;go copy
52
+	.list
53
+dx0010  lda  #badsyn    ; syntax error
54
+        jmp  cmderr      
55
+dx0020  lda  image      ; chk for normal
56
+        and  #%11011001          
57
+        bne  dx0010      
58
+        jmp  copy        
59
+	.nlist
60
+;.end
61
+;prseq            
62
+;        lda  #'=        ; special case
63
+;        jsr  parse       
64
+;        bne  x0020       
65
+;x0015   lda  #badsyn     
66
+;        jmp  cmderr      
67
+;x0020   lda  cmdbuf,y    
68
+;        jsr  tst0v1      
69
+;        bmi  x0015       
70
+;        sta  fildrv+1   ; src drv
71
+;        dey      
72
+;        dey      
73
+;        lda  cmdbuf,y    
74
+;        jsr  tst0v1      
75
+;        bmi  x0015       
76
+;        cmp  fildrv+1   ; cannot be equal
77
+;        beq  x0015       
78
+;        sta  fildrv     ; dest drv
79
+;        rts      
80
+	.list

+ 308
- 0
DOS_1571CR/dskintsf.src View File

@@ -0,0 +1,308 @@
1
+        .page  
2
+        .subttl 'dskintsf.src'       
3
+
4
+; error display routine
5
+; blinks the (error #)+1 in all three leds
6
+
7
+pezro   ldx  #0         ; error #1 for zero page
8
+	.byte skip2     ; skip next two bytes
9
+perr    ldx  temp       ; get error #
10
+        txs     	; use stack as storage reg.
11
+pe20    tsx     	; restore error #
12
+pe30    lda  #led0+led1          
13
+        ora  ledprt      
14
+        jmp  pea7a       
15
+
16
+; turn on led !!!!patch so ddrb led is output!!!!
17
+
18
+rea7d   tya     	; clear inner ctr !!!!patch return!!!!
19
+pd10    clc      
20
+pd20    adc  #1         ; count inner ctr
21
+        bne  pd20        
22
+        dey     	; done ?
23
+        bne  pd10       ; no
24
+
25
+        lda  ledprt      
26
+        and  #$ff-led0-led1      
27
+        sta  ledprt     ; turn off all leds
28
+pe40            	; wait
29
+        tya     	; clear inner ctr
30
+pd11    clc      
31
+pd21    adc  #1         ; count inner ctr
32
+        bne  pd21        
33
+        dey     	; done ?
34
+        bne  pd11       ; no
35
+
36
+        dex     	; blinked # ?
37
+        bpl  pe30       ; no - blink again
38
+        cpx  #$fc       ; waited between counts ?
39
+        bne  pe40       ; no
40
+        beq  pe20       ; always - all again
41
+
42
+dskint  sei      
43
+        cld      
44
+        ldx  #$66	; *,atnout,clk,*,*,side,fsdir,trk0
45
+        jmp  patch5     ; *** rom ds 8/18/83 ***
46
+dkit10  inx		; fill		
47
+
48
+;*********************************
49
+;
50
+; power up diagnostic
51
+;
52
+;*********************************
53
+
54
+        ldy  #0          
55
+        ldx  #0          
56
+pu10    txa     	; fill z-page accend pattern
57
+        sta  $0,x        
58
+        inx      
59
+        bne  pu10        
60
+pu20    txa     	; check pattern by inc...
61
+        cmp  $0,x       ; ...back to orig #
62
+        bne  pezro      ; bad bits
63
+pu30             
64
+	inc  $0,x       ; bump contents
65
+        iny      
66
+        bne  pu30       ; not done
67
+
68
+        cmp  $0,x       ; check for good count
69
+        bne  pezro      ; something's wrong
70
+
71
+        sty  $0,x       ; leave z-page zeroed
72
+        lda  $0,x       ; check it
73
+        bne  pezro      ; wrong
74
+
75
+        inx     	; next!
76
+        bne  pu20       ; not all done
77
+
78
+
79
+; test 32k byte rom 
80
+
81
+; enter x=start page
82
+; exit if ok
83
+
84
+rm10    inc  temp       ; next error #
85
+	ldx  #127	; 128 pages
86
+        stx  ip+1       ; save page, start x=0
87
+	inx		; **** rom ds 04/22/86 ***
88
+	lda  #0          
89
+        sta  ip         ; zero lo indirect
90
+	ldy  #2		; skip signature bytes
91
+        clc      
92
+rt10    inc  ip+1       ; do it backwards
93
+rt20    adc  (ip),y     ; total checksum in a
94
+        iny      
95
+        bne  rt20        
96
+
97
+        dex      
98
+        bne  rt10        
99
+
100
+        adc  #255        ; add in last carry
101
+	sta  ip+1
102
+        bne  perr2      ; no - show error number
103
+
104
+; **** rom ds 04/22/86 ***
105
+
106
+	nop		 ; fill
107
+	nop		 ; fill
108
+	nop		 ; fill
109
+
110
+;----------------------------------
111
+
112
+; test all common ram
113
+
114
+cr20    lda  #$01       ; start of 1st block
115
+cr30    sta  ip+1       ; save page #
116
+        inc  temp       ; bump error #
117
+
118
+; enter x=# of pages in block
119
+; ip ptr to first page in block
120
+; exit if ok
121
+
122
+ramtst  ldx  #7         ; save page count
123
+ra10    tya     	; fill with adr sensitive pattern
124
+        clc      
125
+        adc  ip+1        
126
+        sta  (ip),y      
127
+        iny      
128
+        bne  ra10        
129
+        inc  ip+1        
130
+        dex      
131
+        bne  ra10        
132
+        ldx  #7         ; restore page count
133
+ra30    dec  ip+1       ; check pattern backwards
134
+ra40    dey      
135
+        tya     	; gen pattern again
136
+        clc      
137
+        adc  ip+1        
138
+        cmp  (ip),y     ; ok ?
139
+        bne  perr2      ; no - show error #
140
+        eor  #$ff       ; yes - test inverse pattern
141
+        sta  (ip),y      
142
+        eor  (ip),y     ; ok ?
143
+        sta  (ip),y     ; leave memory zero
144
+        bne  perr2      ; no - show error #
145
+        tya      
146
+        bne  ra40        
147
+        dex      
148
+        bne  ra30        
149
+
150
+        beq  diagok      
151
+
152
+perr2   jmp  perr        
153
+
154
+diagok  
155
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>         
156
+
157
+	jmp  ptch31	; *** rom ds 05/01/85 ***
158
+;       ldx  #topwrt     
159
+;       txs      
160
+
161
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>         
162
+
163
+rtch31  lda  ledprt     ; clear leds
164
+        and  #$ff-led0-led1      
165
+        sta  ledprt      
166
+
167
+        lda  #3         ; neg edge of atn & edge on wp
168
+        sta  pcr1        
169
+        lda  #%10000010 ; set,_t1,_t2,_cb1,_cb2,_sr,ca1,_ca2(wps)
170
+        sta  ifr1        
171
+	sta  ier1        
172
+        lda  pb         ; compute primary addr
173
+        and  #%01100000 ; pb5 and pb6 are unused lines
174
+        asl  a          ; shift to lower
175
+        rol  a   
176
+        rol  a   
177
+        rol  a   
178
+        ora  #$48       ; talk address
179
+        sta  tlkadr      
180
+        eor  #$60       ; listen address
181
+        sta  lsnadr      
182
+
183
+; initialize buffer pntr table
184
+
185
+inttab  ldx  #0          
186
+        ldy  #0          
187
+intt1   lda  #0          
188
+        sta  buftab,x    
189
+        inx      
190
+        lda  bufind,y    
191
+        sta  buftab,x    
192
+        inx      
193
+        iny      
194
+        cpy  #bfcnt      
195
+        bne  intt1       
196
+
197
+        lda  #<cmdbuf   ; set pntr to cmdbuf
198
+        sta  buftab,x    
199
+        inx      
200
+        lda  #>cmdbuf    
201
+        sta  buftab,x    
202
+        inx      
203
+        lda  #<errbuf   ; set pntr to errbuf
204
+        sta  buftab,x    
205
+        inx      
206
+        lda  #>errbuf    
207
+        sta  buftab,x    
208
+
209
+        lda  #$ff        
210
+        ldx  #maxsa      
211
+dskin1  sta  lintab,x    
212
+        dex      
213
+        bpl  dskin1      
214
+
215
+        ldx  #mxchns-1   
216
+dskin2           
217
+        sta  buf0,x     ; set buffers as unused
218
+        sta  buf1,x      
219
+        sta  ss,x        
220
+        dex      
221
+        bpl  dskin2      
222
+
223
+        lda  #bfcnt     ; set buffer pointers
224
+        sta  buf0+cmdchn         
225
+        lda  #bfcnt+1    
226
+        sta  buf0+errchn         
227
+        lda  #$ff        
228
+        sta  buf0+blindx         
229
+        sta  buf1+blindx         
230
+
231
+        lda  #errchn     
232
+        sta  lintab+errsa        
233
+        lda  #cmdchn+$80         
234
+        sta  lintab+cmdsa        
235
+        lda  #lxint     ; lindx 0 to 5 free
236
+        sta  linuse      
237
+
238
+        lda  #rdylst     
239
+        sta  chnrdy+cmdchn       
240
+        lda  #rdytlk     
241
+        sta  chnrdy+errchn       
242
+        lda  #$e0        
243
+        sta  bufuse      
244
+        lda  #$ff        
245
+        sta  bufuse+1    
246
+
247
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
248
+
249
+	jsr  ptch72	; *** rom ds 05/20/86 ***
250
+	nop
251
+;       lda  #1          
252
+;       sta  wpsw        
253
+
254
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
255
+
256
+        sta  wpsw+1      
257
+        jsr  usrint     ; init user jmp
258
+        jsr  lruint      
259
+
260
+;**********************************
261
+;
262
+; controller initialization
263
+;
264
+;**********************************
265
+
266
+        jsr  ptch10     ; *** rom ds 05/01/85 controller init ***
267
+;       jsr  cntint
268
+
269
+; set indirect vectors
270
+
271
+        lda  #<diagok    
272
+        sta  vnmi        
273
+        lda  #>diagok    
274
+        sta  vnmi+1      
275
+
276
+        lda  #6	        ; set up sector offset *** rom ds 01/22/85 ***
277
+        sta  secinc      
278
+        lda  #5          
279
+        sta  revcnt     ; set up recovery count
280
+
281
+;*
282
+;*******************************
283
+;*
284
+;*    seterr
285
+;*    set up power on error msg
286
+;*
287
+;*******************************
288
+;*
289
+;*
290
+seterr  lda  #$73        
291
+        jsr  errts0      
292
+
293
+
294
+;must be contiguous to .file idle
295
+
296
+;********************************
297
+; init the serial bus
298
+;
299
+;********************************
300
+
301
+;-------rom -05 8/18/83-----------------
302
+        lda  #$00       ;  data hi, clock hi,atna hi
303
+        sta  pb          
304
+        lda  #%00011010 ;  atna,clkout,datout
305
+        sta  ddrb1       
306
+;---------------------------------------
307
+    	jsr  ptch29	; *rom ds 02/01/85*
308
+;       jsr  boot        

+ 36
- 0
DOS_1571CR/duplct.src View File

@@ -0,0 +1,36 @@
1
+        .page 
2
+        .subttl 'duplct.src'
3
+
4
+; duplicate disk
5
+
6
+duplct           
7
+        lda  #badcmd     
8
+        jmp  cmderr      
9
+
10
+; transfer format code to buffer 0
11
+;  & start controller formatting
12
+
13
+format           
14
+        lda  #$4c        
15
+        sta  bufs+$300   
16
+
17
+        lda  #<formt     
18
+        sta  bufs+$301   
19
+        lda  #>formt     
20
+        sta  bufs+$302   
21
+
22
+        lda  #3          
23
+        jsr  seth        
24
+        lda  drvnum      
25
+        ora  #exec       
26
+        sta  jobs+3      
27
+fmt105  lda  jobs+3      
28
+        bmi  fmt105      
29
+
30
+        cmp  #2          
31
+        bcc  fmt110      
32
+
33
+        lda  #3          
34
+        ldx  #0          
35
+        jmp  error       
36
+fmt110  rts      

+ 70
- 0
DOS_1571CR/duplct1.src View File

@@ -0,0 +1,70 @@
1
+	.page
2
+	.subttl 'duplct1.src'
3
+
4
+;  controller format disk
5
+
6
+jformat lda  #71	
7
+	sta  maxtrk	; double sided
8
+	lda  #3          
9
+        jsr  seth        
10
+        ldx  #3         ; job #3
11
+	lda  #0
12
+	sta  fmtsid	; side zero first
13
+        lda  #$f0       ; format cmd
14
+        sta  tsttrk     ; init speed var
15
+        sta  jobs,x     ; give job to controller
16
+        jsr  stbctl     ; wake him up
17
+        cmp  #2         ; error?
18
+        bcs  1$		; br, error
19
+
20
+;read track one sector zero
21
+
22
+	ldy  #3		; retries
23
+4$      lda  #1         ; track 1
24
+        sta  hdrs+6     ; *
25
+        lda  #0         ; sector 0
26
+        sta  hdrs+7     ; *
27
+        lda  #$80       ; read
28
+        sta  jobs,x     ; give job to controller
29
+        jsr  stbctl     ; wake him up
30
+        cmp  #2         ; error?
31
+        bcc  5$		; br, ok...
32
+	
33
+	dey
34
+	bpl  4$		; try 3 times
35
+	bcs  1$		; bra
36
+
37
+5$	lda  #1
38
+	sta  fmtsid	; side one second
39
+        lda  #$f0       ; format cmd
40
+        sta  tsttrk     ; init speed var
41
+        sta  jobs,x     ; give job to controller
42
+        jsr  stbctl     ; wake him up
43
+        cmp  #2         ; error?
44
+        bcs  1$		; br, error
45
+
46
+;read track thirty-six sector zero
47
+
48
+	ldy  #3		; retries
49
+6$      lda  #36        ; track 36
50
+        sta  hdrs+6     ; *
51
+        lda  #0         ; sector 0
52
+        sta  hdrs+7     ; *
53
+        lda  #$80       ; read
54
+        sta  jobs,x     ; give job to controller
55
+        jsr  stbctl     ; wake him up
56
+        cmp  #2         ; error?
57
+	bcs  3$		; br, bad
58
+
59
+	rts		; ok
60
+	
61
+3$	dey
62
+	bpl  6$		; keep trying
63
+
64
+1$      ldx  #0         ; set for offset for buffer to det. trk & sect.
65
+	bit  jobrtn	; return on error ?
66
+	stx  jobrtn	; clr
67
+	bpl  7$
68
+
69
+	rts		; back to caller
70
+7$	jmp  error

+ 439
- 0
DOS_1571CR/erproccr.src View File

@@ -0,0 +1,439 @@
1
+        .page  
2
+        .subttl 'erproc.src'          
3
+; error processing 
4
+
5
+; controller errors
6
+;  0  (1)  no error
7
+; 20  (2)  can't find block header
8
+; 21  (3)  no synch character
9
+; 22  (4)  data block not present
10
+; 23  (5)  checksum error in data
11
+; 24  (16) byte decoding error
12
+; 25  (7)  write-verify error
13
+; 26  (8)  write w/ write protect on
14
+; 27  (9)  checksum error in header
15
+; 28  (10) data extends into next block
16
+; 29  (11) disk i.d. mismatch
17
+
18
+; command errors
19
+; 30  general syntax
20
+; 31  invalid command
21
+; 32  long line
22
+; 33  invalid filname
23
+; 34  no file given
24
+; 39  command file not found
25
+
26
+; 50  record not present
27
+; 51  overflow in record
28
+; 52  file too large
29
+
30
+; 60  file open for write
31
+; 61  file not open
32
+; 62  file not found
33
+; 63  file exists
34
+; 64  file type mismatch
35
+; 65  no block
36
+; 66  illegal track or sector
37
+; 67  illegal system t or s
38
+
39
+; 70  no channels available
40
+; 71  directory error
41
+; 72  disk full
42
+; 73  cbm dos v3.1
43
+; 74  drive not ready
44
+
45
+;  1  files scratched response
46
+
47
+badsyn   =$30    
48
+badcmd   =$31    
49
+longln   =$32    
50
+badfn    =$33    
51
+nofile   =$34    
52
+nocfil   =$39    
53
+norec    =$50    
54
+recovf   =$51    
55
+bigfil   =$52    
56
+filopn   =$60    
57
+filnop   =$61    
58
+flntfd   =$62    
59
+flexst   =$63    
60
+mistyp   =$64    
61
+noblk    =$65    
62
+badts    =$66    
63
+systs    =$67    
64
+nochnl   =$70    
65
+direrr   =$71    
66
+dskful   =$72    
67
+cbmv2    =$73    
68
+nodriv   =$74    
69
+        .page    
70
+; error message table
71
+;   leading errror numbers,
72
+;   text with 1st & last chars 
73
+;   or'ed with $80,
74
+;   tokens for key words are
75
+;   less than $10 (and'ed w/ $80)
76
+
77
+errtab          ; " OK"
78
+	.byte    0,$a0,'O',$cb   
79
+;"read error"
80
+	.byte    $20,$21,$22,$23,$24,$27         
81
+	.byte    $d2,'EAD',$89   
82
+;" file too large"
83
+	.byte    $52,$83,' TOO LARG',$c5       
84
+;" record not present"
85
+	.byte    $50,$8b,6,' PRESEN',$d4        
86
+;"overflow in record"
87
+	.byte    $51,$cf,'VERFLOW '     
88
+	.byte    'IN',$8b        
89
+;" write error"
90
+	.byte    $25,$28,$8a,$89         
91
+;" write protect on"
92
+	.byte    $26,$8a,' PROTECT O',$ce      
93
+;" disk id mismatch"
94
+	.byte    $29,$88,' ID',$85      
95
+;"syntax error"
96
+	.byte    $30,$31,$32,$33,$34     
97
+	.byte    $d3,'YNTAX',$89         
98
+;" write file open"
99
+	.byte    $60,$8a,3,$84   
100
+;" file exists"
101
+	.byte    $63,$83,' EXIST',$d3   
102
+;" file type mismatch"
103
+	.byte    $64,$83,' TYPE',$85    
104
+;"no block"
105
+	.byte    $65,$ce,'O BLOC',$cb   
106
+;"illegal track or sector"
107
+	.byte   $66,$67,$c9,'LLEGAL TRACK'     
108
+	.byte   ' OR SECTO',$d2       
109
+;" file not open"
110
+	.byte    $61,$83,6,$84   
111
+;" file not found"
112
+	.byte    $39,$62,$83,6,$87       
113
+;" files scratched"
114
+	.byte    1,$83,'S SCRATCHE',$c4         
115
+;"no channel"
116
+	.byte    $70,$ce,'O CHANNE',$cc         
117
+;"dir error"
118
+	.byte    $71,$c4,'IR',$89        
119
+;" disk full"
120
+	.byte    $72,$88,' FUL',$cc     
121
+;"cbm dos v3.1 1571"
122
+	.byte   $73,$c3,'BM DOS V3.1 157',$b1        
123
+;"drive not ready"
124
+	.byte   $74,$c4,'RIVE',6,' READ',$d9   
125
+
126
+; error token key words
127
+;   words used more than once
128
+;"error"
129
+	.byte    9,$c5,'RRO',$d2         
130
+;"write"
131
+	.byte    $a,$d7,'RIT',$c5        
132
+;"file"
133
+	.byte    3,$c6,'IL',$c5          
134
+;"open"
135
+	.byte    4,$cf,'PE',$ce          
136
+;"mismatch"
137
+	.byte    5,$cd,'ISMATC',$c8      
138
+;"not"
139
+	.byte    6,$ce,'O',$d4   
140
+;"found"
141
+	.byte    7,$c6,'OUN',$c4         
142
+;"disk"
143
+	.byte    8,$c4,'IS',$cb          
144
+;"record"
145
+	.byte   $b,$d2,'ECOR',$c4       
146
+etend    =*      
147
+        .page    
148
+; controller error entry
149
+;   .a= error #
150
+;   .x= job #
151
+error   
152
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
153
+
154
+	jmp  ptch46	; *** rom ds 03/31/85 ***
155
+;	pha      
156
+;       stx  jobnum      
157
+
158
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
159
+
160
+rtch46  txa      
161
+        asl  a   
162
+        tax      
163
+        lda  hdrs,x     ; 4/12********* track,sector
164
+        sta  track       
165
+        lda  hdrs+1,x   ; 4/12*********
166
+        sta  sector      
167
+
168
+        pla      
169
+        and  #$f        ; convert controller...
170
+        beq  err1       ; ...errors to dos errors
171
+        cmp  #$f        ; check nodrive error
172
+        bne  err2        
173
+
174
+        lda  #nodriv     
175
+        bne  err3       ; bra
176
+err1             
177
+        lda  #6         ; code=16-->14
178
+err2    ora  #$20        
179
+        tax      
180
+        dex      
181
+        dex      
182
+        txa      
183
+err3             
184
+        pha      
185
+        lda  cmdnum      
186
+        cmp  #val        
187
+        bne  err4        
188
+        lda  #$ff        
189
+        sta  cmdnum      
190
+        pla      
191
+        jsr  errmsg      
192
+        jsr  initdr     ; init for validate
193
+        jmp  cmder3      
194
+err4             
195
+        pla      
196
+cmder2           
197
+        jsr  errmsg      
198
+cmder3           
199
+        jsr  clrcb      ; clear cmdbuf
200
+        lda  #0          
201
+        sta  wbam       ; clear after error
202
+        jsr  erron      ; set error led
203
+        jsr  freich     ; free internal channel
204
+        lda  #0         ; clear pointers
205
+        sta  buftab+cbptr        
206
+        ldx  #topwrt     
207
+        txs     	;  purge stack
208
+        lda  orgsa       
209
+        and  #$f         
210
+        sta  sa          
211
+        cmp  #$f         
212
+        beq  err10       
213
+        sei      
214
+        lda  lsnact      
215
+        bne  lsnerr      
216
+        lda  tlkact      
217
+        bne  tlkerr      
218
+
219
+        ldx  sa          
220
+        lda  lintab,x    
221
+        cmp  #$ff        
222
+        beq  err10       
223
+        and  #$f         
224
+        sta  lindx       
225
+        jmp  tlerr       
226
+
227
+
228
+; talker error recovery
229
+;  if command channel, release dav
230
+;  if data channel, force not ready
231
+;   and release channel
232
+tlkerr           
233
+        jsr  fndrch      
234
+;       jsr iterr 		; *** rom - 05 fix 8/18/83 ***
235
+	.byte  $ea,$ea,$ea      ; fill in 'jsr'
236
+        bne  tlerr      	; finish
237
+
238
+; listener error recovery
239
+;  if command channel, release rfd
240
+;  if data channel, force not ready
241
+;  and release channel
242
+lsnerr           
243
+        jsr  fndwch      
244
+;       jsr ilerr 		; *** rom - 05 fix 8/18/83 ***
245
+	.byte  $ea,$ea,$ea      ; fill in 'jsr'
246
+tlerr            
247
+        jsr  typfil      
248
+        cmp  #reltyp     
249
+        bcs  err10       
250
+        jsr  frechn      
251
+err10            
252
+
253
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
254
+
255
+	jmp  xidle		; *** rom ds 01/22/84 ***
256
+;       jmp  idle        
257
+
258
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
259
+
260
+        .page    
261
+; convert hex to bcd
262
+hexdec  tax      
263
+
264
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
265
+	
266
+	jmp  ptch67	; *** rom sd 05/21/86 ***
267
+;       lda  #0          
268
+;       sed      
269
+
270
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
271
+
272
+hex0    cpx  #0          
273
+        beq  hex5        
274
+        clc      
275
+        adc  #1          
276
+        dex      
277
+        jmp  hex0        
278
+hex5    cld      
279
+
280
+; convert bcd to ascii dec
281
+;  return bcd in .x
282
+;  store ascii in (temp),y
283
+bcddec  tax      
284
+        lsr  a   
285
+        lsr  a   
286
+        lsr  a   
287
+        lsr  a   
288
+        jsr  bcd2        
289
+        txa      
290
+bcd2             
291
+        and  #$f         
292
+        ora  #$30        
293
+        sta  (cb+2),y    
294
+        iny      
295
+        rts      
296
+
297
+; transfer error message to
298
+;  error buffer
299
+
300
+okerr            
301
+        jsr  erroff      
302
+        lda  #0          
303
+errts0           
304
+        ldy  #0          
305
+        sty  track       
306
+        sty  sector      
307
+
308
+errmsg           
309
+        ldy  #0          
310
+        ldx  #<errbuf    
311
+        stx  cb+2        
312
+        ldx  #>errbuf    
313
+        stx  cb+3        
314
+        jsr  bcddec     ; convert error #
315
+        lda  #',         
316
+        sta  (cb+2),y    
317
+        iny      
318
+        lda  errbuf      
319
+        sta  chndat+errchn       
320
+        txa     	; error # in .x
321
+        jsr  ermove     ; move message
322
+
323
+ermsg2  lda  #',         
324
+        sta  (cb+2),y    
325
+        iny      
326
+        lda  track       
327
+        jsr  hexdec     ; convert track #
328
+        lda  #',         
329
+        sta  (cb+2),y    
330
+        iny      
331
+        lda  sector     ; convert sector #
332
+        jsr  hexdec      
333
+        dey      
334
+        tya      
335
+        clc      
336
+        adc  #<errbuf   ; set last char
337
+        sta  lstchr+errchn      
338
+        inc  cb+2        
339
+        lda  #rdytlk     
340
+        sta  chnrdy+errchn       
341
+        rts      
342
+
343
+;**********************************;
344
+;*    ermove - move error message *;
345
+;*      from errtab to errbuf.    *;
346
+;*      fully recursive for token *;
347
+;*      word prosessing.          *;
348
+;*   input: .a= bcd error number  *;
349
+;**********************************;
350
+
351
+ermove           
352
+        tax     	; save .a
353
+        lda  r0         ; save r0,r0+1
354
+        pha      
355
+        lda  r0+1        
356
+        pha      
357
+        lda  #<errtab   ; set pointer to table
358
+        sta  r0          
359
+        lda  #>errtab    
360
+        sta  r0+1        
361
+        txa     	; restore .a
362
+        ldx  #0         ; .x=0 for indirect
363
+e10              
364
+        cmp  (r0,x)     ; ?error # = table entry?
365
+        beq  e50        ; yes, send message
366
+
367
+        pha     	; save error #
368
+        jsr  eadv2      ; check & advance ptr
369
+        bcc  e30        ; more #'s to check
370
+e20              
371
+        jsr  eadv2      ; advance past this message
372
+        bcc  e20         
373
+e30              
374
+        lda  r0+1       ; check ptr
375
+        cmp  #>etend     
376
+        bcc  e40        ; <, continue
377
+        bne  e45        ; >, quit
378
+
379
+        lda  #<etend     
380
+        cmp  r0          
381
+        bcc  e45        ; past end of table
382
+e40              
383
+        pla     	; restore error #
384
+        jmp  e10        ; check next entry
385
+e45              
386
+        pla     	; pop error #
387
+        jmp  e90        ; go quit
388
+
389
+e50             	; the number has been located
390
+        jsr  eadv1       
391
+        bcc  e50        ; advance past other #'s
392
+e55              
393
+        jsr  e60         
394
+        jsr  eadv1       
395
+        bcc  e55         
396
+
397
+        jsr  e60        ; check for token or last word
398
+e90              
399
+        pla     	; all finished
400
+        sta  r0+1       ; restore r0
401
+        pla      
402
+        sta  r0          
403
+        rts      
404
+
405
+e60              
406
+        cmp  #$20       ; (max token #)+1
407
+        bcs  e70        ; not a token
408
+        tax      
409
+        lda  #$20       ; implied leading space
410
+        sta  (cb+2),y    
411
+        iny      
412
+        txa     	; restore token #
413
+        jsr  ermove     ; add token word to message
414
+        rts      
415
+e70              
416
+        sta  (cb+2),y   ; put char in message
417
+        iny      
418
+        rts      
419
+
420
+;error advance & check
421
+
422
+eadv1           	; pre-increment
423
+        inc  r0         ; advance ptr
424
+        bne  ea10        
425
+        inc  r0+1        
426
+ea10             
427
+        lda  (r0,x)     ; get current entry
428
+        asl  a          ; .c=1 is end or beginning
429
+        lda  (r0,x)      
430
+        and  #$7f       ; mask off bit7
431
+        rts      
432
+
433
+eadv2           	; post-increment
434
+        jsr  ea10       ; check table entry
435
+        inc  r0          
436
+        bne  ea20        
437
+        inc  r0+1        
438
+ea20             
439
+        rts      

+ 309
- 0
DOS_1571CR/fastld.src View File

@@ -0,0 +1,309 @@
1
+        .page  
2
+	.subttl 'fastld.src'
3
+
4
+fstload jsr  spout	; output
5
+	jsr  set_fil	; setup filename for parser
6
+	bcs  9$
7
+
8
+        jsr  autoi	; init mechanism
9
+	lda  nodrv	; chk status
10
+	bne  9$		; no drive status
11
+
12
+	lda  fastsr	; set error recovery flag on
13
+	ora  #$81	; & eoi flag
14
+	sta  fastsr	
15
+	jsr  findbuf	; check for buffer availabilty
16
+
17
+	lda  cmdbuf
18
+	cmp  #'*	; load last ?
19
+	bne  7$
20
+	
21
+	lda  prgtrk	; any file ?
22
+	beq  7$
23
+
24
+	pha		; save track
25
+	lda  prgsec
26
+	sta  filsec	; update
27
+	pla
28
+	jmp  1$
29
+
30
+7$	lda  #0          
31
+	tay
32
+	tax		; clear .a, .x, .y
33
+        sta  lstdrv     ; init drive number
34
+	sta  filtbl	; set up for file name parser
35
+        jsr  onedrv     ; select drive
36
+	lda  f2cnt
37
+	pha	
38
+	lda  #1
39
+	sta  f2cnt
40
+	lda  #$ff
41
+	sta  r0		; set flag
42
+	jsr  lookup	; locate file
43
+	pla		 
44
+	sta  f2cnt	; restore var
45
+	lda  fastsr
46
+	and  #$7f	; clr error recovery flag
47
+	sta  fastsr
48
+	bit  switch	; seq flag set ?
49
+	bmi  8$
50
+
51
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
52
+
53
+; 	lda  pattyp	; is it a program file ?
54
+;	cmp  #2
55
+	jsr  ptch56	; *** rom ds 07/15/85 ***
56
+	nop		; fill
57
+
58
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
59
+
60
+	bne  6$		; not prg
61
+
62
+8$      lda  filtrk     ; check if found. err if not
63
+        bne  1$		; br, file found
64
+
65
+6$    	ldx  #%00000010	; file not found
66
+	.byte skip2
67
+9$	ldx  #%00001111	; no drive
68
+        jmp  sys_err	
69
+
70
+1$      sta  prgtrk	; save for next
71
+	pha		; save track
72
+	jsr  set_buf	; setup buffer allocation
73
+	pla		; get track
74
+	ldx  channel	; get channel offset
75
+	sta  hdrs,x	; setup track
76
+        lda  filsec     ; & sector
77
+	sta  prgsec	; for next time
78
+        sta  hdrs+1,x
79
+
80
+	lda  #read	; read job
81
+	sta  cmdbuf+2	; save read cmd
82
+	sta  ctl_cmd	
83
+
84
+2$	cli		; let controller run
85
+	ldx  jobnum	; get job #
86
+	lda  ctl_cmd	; get cmd
87
+	sta  jobs,x	; send cmd
88
+	jsr  stbctr	; whack the controller in the head
89
+	cpx  #2		; error ?
90
+	bcc  5$
91
+	
92
+	jmp  ctr_err
93
+
94
+5$	sei
95
+	ldy  #0
96
+	lda  (dirbuf),y	; check status
97
+	beq  end_of_file	
98
+
99
+	lda  fastsr	; clear flag
100
+	and  #$fe
101
+	sta  fastsr
102
+
103
+	jsr  handsk	; handshake error to the host
104
+
105
+	ldy  #2
106
+3$	lda  (dirbuf),y
107
+	tax		; save data in .x
108
+	jsr  handsk	; handshake it to the host
109
+	iny
110
+	bne  3$
111
+
112
+	ldx  channel	; jobnum * 2
113
+	lda  (dirbuf),y ; .y = 0
114
+	cmp  hdrs,x	; same as previous track ?
115
+	beq  4$
116
+
117
+	ldy  #read
118
+	.byte skip2
119
+4$	ldy  #fread	; fast read
120
+	sty  ctl_cmd	; command to seek then read
121
+	sta  hdrs,x	; next track
122
+	ldy  #1		; sector entry
123
+	lda  (dirbuf),y	
124
+	sta  hdrs+1,x	; next sector	
125
+	jmp  2$
126
+
127
+
128
+end_of_file
129
+	ldx  #$1f	; eof
130
+	jsr  handsk	; handshake it to the host
131
+
132
+	lda  #1
133
+	bit  fastsr	; first time through ?
134
+	beq  1$	        ; br, nope
135
+
136
+	tay		; .y = 1
137
+	lda  (dirbuf),y	; number of bytes
138
+	sec
139
+	sbc  #3
140
+	sta  ctl_dat	; save it
141
+	tax		; send it
142
+	jsr  handsk	; handshake it to the host
143
+
144
+	iny		; next
145
+	lda  (dirbuf),y	; address low
146
+	tax
147
+	jsr  handsk	; handshake it to the host
148
+
149
+	iny
150
+	lda  (dirbuf),y	; address high
151
+	tax
152
+	jsr  handsk	; handshake it to the host
153
+	ldy  #4		; skip addresses
154
+	bne  3$		; bra
155
+
156
+1$      ldy  #1
157
+	lda  (dirbuf),y	; number of bytes
158
+	tax
159
+	dex
160
+	stx  ctl_dat	; save here
161
+	jsr  handsk	; handshake it to the host
162
+
163
+	ldy  #2		; start at data
164
+3$	lda  (dirbuf),y
165
+	tax
166
+	jsr  handsk	; handshake it to the host
167
+	iny
168
+	dec  ctl_dat	; use it as a temp
169
+	bne  3$
170
+
171
+	lda  #0
172
+	sta  sa
173
+	jsr  close	; close channel	(faux)
174
+	jmp  endcmd
175
+;
176
+;
177
+;
178
+; *************************
179
+; ***** ERROR HANDLER *****
180
+; *************************
181
+
182
+ctr_err sei		; no irq's
183
+	stx  ctl_dat	; save status here
184
+	jsr  handsk	; handshake it to the host
185
+	lda  #0
186
+	sta  sa
187
+	jsr  close	; close channel (faux)
188
+	ldx  jobnum
189
+	lda  ctl_dat	; get error
190
+	jmp  error	; error out.....	
191
+
192
+sys_err sei
193
+	stx  ctl_dat	; save error
194
+	ldx  #2		; file not found 
195
+	jsr  handsk	; give it to him
196
+	lda  #0
197
+	sta  sa
198
+	jsr  close	; close channel (faux)
199
+	lda  ctl_dat	; get error back
200
+	cmp  #2
201
+	beq  1$
202
+
203
+	lda  #nodriv	; no active drive
204
+	.byte skip2
205
+1$	lda  #flntfd	; file not found
206
+	jmp  cmderr	; never more...
207
+;
208
+;
209
+;
210
+; *************************************
211
+; ***** FIND INTERNAL READ BUFFER *****
212
+; *************************************
213
+
214
+findbuf lda  #0
215
+	sta  sa		; psydo-load 
216
+	lda  #1		; 1 buffer
217
+	jsr  getrch	; find a read channel
218
+	tax
219
+	lda  bufind,x	; get buffer
220
+	sta  dirbuf+1	; set it up indirect
221
+	rts	
222
+;
223
+;
224
+;
225
+; **************************************
226
+; ***** SETUP INTERNAL READ BUFFER *****
227
+; **************************************
228
+
229
+set_buf lda  dirbuf+1	; index to determine job
230
+	sec
231
+	sbc  #3
232
+	sta  jobnum	; save in jobnum
233
+	asl  a
234
+	sta  channel	; save channel off
235
+	lda  #0
236
+	sta  dirbuf	; even page boundary
237
+	rts
238
+;
239
+;
240
+;
241
+; *************************************
242
+; ***** FAST LOAD FILENAME PARSER *****
243
+; *************************************
244
+
245
+set_fil ldy  #3		; default .y
246
+	lda  cmdsiz	; delete burst load command
247
+	sec
248
+	sbc  #3
249
+	sta  cmdsiz	; new command size
250
+
251
+	lda  cmdbuf+4   ; drv # given ?
252
+	cmp  #':
253
+	bne  1$
254
+
255
+	lda  cmdbuf+3
256
+	tax		; save 
257
+	and  #'0
258
+	cmp  #'0        ; 0:file ?
259
+	bne  1$
260
+
261
+	cpx  #'1	; chk for error
262
+	beq  4$			
263
+
264
+1$	lda  cmdbuf+3   ; drv # given ?
265
+	cmp  #':
266
+	bne  2$
267
+
268
+	dec  cmdsiz
269
+	iny
270
+
271
+2$	ldx  #0		; start at cmdbuf+0
272
+3$      lda  cmdbuf,y	; extract file-name
273
+	sta  cmdbuf,x
274
+	iny
275
+	inx
276
+	cpx  cmdsiz	; done ?
277
+	bne  3$		; delete cmd from buffer
278
+
279
+	clc
280
+	.byte skip1
281
+4$	sec		; error
282
+	rts
283
+
284
+
285
+
286
+handsk			; .x contains data
287
+1$	lda  pb		; debounce
288
+        cmp  pb
289
+        bne  1$
290
+
291
+	and  #$ff	; set/clr neg flag
292
+        bmi  3$		; br, attn low 
293
+
294
+        eor  fastsr     ; wait for state chg
295
+        and  #4          
296
+        beq  1$
297
+
298
+        stx  sdr	; send it
299
+        lda  fastsr      
300
+        eor  #4         ; change state of clk
301
+        sta  fastsr      
302
+
303
+        lda  #8
304
+2$	bit  icr	; wait transmission time
305
+        beq  2$
306
+
307
+        rts      
308
+
309
+3$	jmp  ptch30	; bye-bye the host wants us

+ 1362
- 0
DOS_1571CR/fastutl.src
File diff suppressed because it is too large
View File


+ 185
- 0
DOS_1571CR/fndrel.src View File

@@ -0,0 +1,185 @@
1
+	.page   
2
+	.subttl 'fndrel.src'        
3
+;********************************
4
+;*
5
+;* find relative file
6
+;*
7
+;* version 2.5
8
+;*
9
+;*
10
+;* inputs
11
+;*  recl   - 1byte=lo record #
12
+;*  rech   - 1byte=hi record #
13
+;*  rs 	   - 1byte=record size
14
+;*  recptr - 1byte=first byte
15
+;*            wanted from record
16
+;*
17
+;* outputs
18
+;*  ssnum  - 1byte=side sector #
19
+;*  ssind  - 1byte=index into ss
20
+;*  relptr - 1byte=ptr to first
21
+;*            byte wanted
22
+;*
23
+;********************************
24
+
25
+fndrel  jsr  mulply     ; result=rn*rs+rp
26
+        jsr  div254     ; divide by 254
27
+        lda  accum+1    ; save remainder
28
+        sta  relptr      
29
+        jsr  div120     ; divide by 120
30
+        inc  relptr      
31
+        inc  relptr      
32
+        lda  result     ; save quotient
33
+        sta  ssnum       
34
+        lda  accum+1    ; save remainder
35
+        asl  a          ; calc index into ss
36
+        clc      
37
+        adc  #16        ; skip link table
38
+        sta  ssind       
39
+        rts      
40
+
41
+
42
+
43
+; multiply
44
+
45
+; result=recnum*rs+recptr
46
+
47
+;  destroys a,x
48
+
49
+mulply  jsr  zerres     ; result=0
50
+        sta  accum+3    ; a=0
51
+        ldx  lindx      ; get index
52
+        lda  recl,x      
53
+        sta  accum+1     
54
+        lda  rech,x      
55
+        sta  accum+2     
56
+        bne  mul25      ; adjust for rec #1 &...
57
+        lda  accum+1    ; ...#0 = 1st rec
58
+        beq  mul50       
59
+mul25   lda  accum+1     
60
+        sec      
61
+        sbc  #1          
62
+        sta  accum+1     
63
+        bcs  mul50       
64
+        dec  accum+2     
65
+mul50            
66
+        lda  rs,x       ; copy recsiz
67
+        sta  temp        
68
+mul100  lsr  temp       ; do an add ?
69
+        bcc  mul200     ; no
70
+        jsr  addres     ; result=result+accum+1,2,3
71
+mul200  jsr  accx2      ; 2*(accum+1,2,3)
72
+        lda  temp       ; done ?
73
+        bne  mul100     ; no
74
+        lda  recptr     ; add in last bit
75
+        clc      
76
+        adc  result      
77
+        sta  result      
78
+        bcc  mul400     ; skip no carry
79
+        inc  result+1    
80
+        bne  mul400      
81
+        inc  result+2    
82
+mul400  rts      
83
+
84
+
85
+
86
+; divide
87
+
88
+; result=quotient ,accum+1=remainder
89
+
90
+;  destroys a,x
91
+
92
+div254  lda  #254       ; divide by 254
93
+	.byte  skip2	; skip two bytes
94
+div120  lda  #120       ; divide by 120
95
+        sta  temp       ; save divisor
96
+        ldx  #3