-
Notifications
You must be signed in to change notification settings - Fork 82
/
lstdir.src
121 lines (107 loc) · 1.67 KB
/
lstdir.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
.page
.subttl lstdir
; start the directory loading function
; get the buffer and get it started
stdir lda #0
sta sa
lda #1 ;allocate chanl and 1 bufefer
jsr getrch
lda #0
jsr setpnt
ldx lindx
lda #0
sta lstchr,x
jsr getact
tax
lda drvnum
sta lstjob,x
lda #1 ;put sal in buffer
jsr putbyt
lda #4 ;put sah in buffer
jsr putbyt
lda #1 ;insert phoney links (0101)
jsr putbyt
jsr putbyt
lda nbtemp
jsr putbyt ;put in drvnum
lda #0
jsr putbyt
jsr movbuf ;get disk name
jsr getact
asl a
tax
dec buftab,x
dec buftab,x
lda #0 ;end of this line
jsr putbyt
dir1 lda #1 ;insert phoney links ($0101)
jsr putbyt
jsr putbyt
jsr getnam ;get #bufrs and file name
bcc dir3 ;test if last entry
lda nbtemp
jsr putbyt
lda nbtemp+1
jsr putbyt
jsr movbuf
lda #0 ;end of entry
jsr putbyt
bne dir1
dir10 jsr getact
asl a
tax
lda #0
sta buftab,x
lda #rdytlk
ldy lindx
sta dirlst
sta chnrdy,y ;directory list buffer full
lda data
rts
dir3 lda nbtemp ;this is end of load
jsr putbyt
lda nbtemp+1
jsr putbyt
jsr movbuf
jsr getact
asl a
tax
dec buftab,x
dec buftab,x
lda #0 ;end of listing (000)
jsr putbyt
jsr putbyt
jsr putbyt
jsr getact
asl a
tay
lda buftab,y
ldx lindx
sta lstchr,x
dec lstchr,x
jmp dir10
; transfer file name to listing buffer
movbuf ldy #0
movb1 lda nambuf,y
jsr putbyt
iny
cpy #27
bne movb1
rts
; get char for directory loading
getdir jsr getbyt
beq getd3
rts
getd3 sta data
ldy lindx
lda lstchr,y
beq gd1
lda #eoiout
sta chnrdy,y
lda data
rts
gd1 pha
jsr dir1
pla
rts
; .end