-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathverdir.src
142 lines (114 loc) · 2.67 KB
/
verdir.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
142
.messg "verdir"
.subttl "verdir"
.page
; validate files with bam
; create new bam according to
; contents of files entered in dir
verdir jsr simprs ; get drive #
jsr initdr
jsr newmap ; set new bam
lda #0
sta delind
jsr srchst ; search first file
bne vd25 ; found one
vd10 lda #0 ; set dir sectors..
sta sector ; ...in bam
lda dirtrk
sta track
jsr vmkbam
jsr mapout ; wrt 'em out
jmp endcmd
vd15 iny
lda (dirbuf),y
pha ; save track
iny
lda (dirbuf),y
pha ; save sector
ldy #19 ; get ss track
lda (dirbuf),y ; is this relative ?
beq vd17 ; no
sta track ; yes - save track
iny
lda (dirbuf),y ; get ss sector
sta sector
jsr vmkbam ; validate ss by links
vd17 pla
sta sector ; now do data blocks
pla
sta track
jsr vmkbam ; set bit used in bam
vd20 jsr srre ; search for more
beq vd10 ; no more files
vd25 ldy #0
lda (dirbuf),y
bpl vd28
and #7 ; par. file?
cmp #5
bne vd15
vd26 jsr setparts ; set partition t&s
jsr allocpart ; allocate t&s
jmp vd20
vd28 jsr deldir ; not closed delete dir
jmp vd20
.pag
vmkbam ; mark bam w/file sectors
jsr tschk
jsr wused
jsr opnird
mrk2 lda #0
jsr setpnt
jsr getbyt
sta track
jsr getbyt
sta sector
lda track
bne mrk1
jmp frechn
mrk1 jsr wused
jsr nxtbuf
jmp mrk2
calcpar
lda lo
bne 1$
lda hi
beq 2$
dec hi
1$ dec lo
inc sector ; next please
lda numsec
cmp sector
bne 2$
lda #0
sta sector ; start over
lda track
cmp dirtrk ; can not overrun system track
beq 3$
inc track ; next
sec
.byte skip1
2$ clc
lda hi
ora lo
rts ; .z=1 done...
3$ lda #systs ; illegal partition track & sector error
jmp cmder2
setparts
ldy #1
lda (dirbuf),y
sta track ; starting track
iny
lda (dirbuf),y
sta sector ; starting sector
ldy #$1C
lda (dirbuf),y
sta lo ; blks used
iny
lda (dirbuf),y
sta hi
rts
allocpart
jsr tschk ; check t&s
jsr wused ; allocate it
jsr calcpar
bne allocpart
rts