-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathdos3.src
141 lines (120 loc) · 2.94 KB
/
dos3.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.page
.subttl 'dos3'
; syntax checker
; routines for dos.write
chk1
and #$e6 ;for header,dload,scrtch
beq chk2 ;chk opt parms
chker1
bne gosner
chk2
lda parsts ;for dsave
and #1
cmp #1 ;chk req'd parms
bne chker1 ;error if 1 missing
lda parsts ;reload for return
rts
chk4
and #$c4 ;for copy,concat
bne chker1 ;chk opt parms
lda parsts
chk5
and #3 ;for rename
cmp #3 ;chk req'd parms
bne chker1
lda parsts ;reload for return
rts
.page
; error on channel read
;
errchl
lda dsdesc ;entry for user
bne echks ;chk old status
lda #40 ;get 40 char str
sta dsdesc ;we have 40 chrs
jsr getspa
stx dsdesc+1 ;return low
sty dsdesc+2 ;return high
ldy #40
jsr patch1 ;(05jul84:fab+tvr) fixes: ?ds$:?fre(0) hangup
nop ;placeholder*********************************
echks
ldx dosfa ;chk bus <=ds read
bne eread ;if =0 default
ldx #8
stx dosfa
eread
lda #doslfn
ldy #$6f
jsr setlfs
lda #0
jsr setnam
jsr open
ldx #doslfn
jsr chkin
bcs errbad ;a problem??
ldy #$ff
loop1
iny
jsr basin
cmp #cr ;check for end
beq errend
sta (dsdesc+1),y
bne loop1 ;br always
errend
lda #0
sta (dsdesc+1),y
jsr clrch
lda #doslfn
sec ;not a real close
jmp close
errbad
pha
jsr errend
jsr oldclr ;flag 'no ds available'
pla ;get error
tax
jmp error
; r-u-sure subroutine
rusure
bit runmod ;direct mode?
bmi ans3 ;no
jsr primm ;prompt user
.byte 'ARE YOU SURE?', 0
jsr clrch ;clear channel for basin
jsr basin ;next char
pha ;save first char of reply
ans1 ;eat chars until end of line
cmp #cr
beq ans2 ;if cr received, exit
jsr basin
bne ans1 ;continue to ignore
ans2
pla
cmp #'Y' ;z set means ans=y.....
rts
ans3
lda #0 ;...or not in direct mode.
rts
; oldclr subroutine
; clears disk status
oldclr
tya ;save y
pha
lda dsdesc ;chk for allocation
beq oldcl1 ;bra if not
ldy #40
tya
sta (dsdesc+1),y ;length of garbage
iny
lda #$ff
sta (dsdesc+1),y ;garbage flaged
oldcl1
lda #0
sta dsdesc ;kill ds$
pla ;restore y
tay
rts
;.end
;(05jul84) fab & tvr: garbage collect following ?ds$ crashed due to messy
; condition of ds$ backpointer. corrected backpointer.