forked from davidgiven/cpm65
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsefcb_test.S
142 lines (120 loc) · 1.61 KB
/
parsefcb_test.S
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
; This file is licensed under the terms of the 2-clause BSD license. Please
; see the COPYING file in the root project directory for the full text.
#include "zif.inc"
#include "bdos.inc"
#include "cpm65.inc"
ZEROPAGE
zproc main
lda #<fcb_buffer
sta user_dma+0
lda #>fcb_buffer
sta user_dma+1
lda #<filenames
sta param+0
lda #>filenames
sta param+1
zrepeat
jsr bdos_PARSEFCB
jsr print_fcb
ldy #0
zrepeat
inc param+0
zif_eq
inc param+1
zendif
lda (param), y
zuntil_eq
inc param+0
zif_eq
inc param+1
zendif
lda (param), y
zuntil_eq
rts
zendproc
filenames:
.ascii "JUSTFITS.TXT"
.byte 0
.ascii "A:JUSTFITS.TXT"
.byte 0
.ascii "SHORT.S"
.byte 0
.ascii "TOOLONGTOOFIT.S"
.byte 0
.ascii "SHORT"
.byte 0
.ascii "TOOLONGTOOFIT"
.byte 0
.ascii ".EXT"
.byte 0
.ascii "lowercase"
.byte 0
.ascii "WILD????"
.byte 0
.ascii "WILD*"
.byte 0
.ascii "WILD*.*"
.byte 0
.ascii "*.*"
.byte 0
.ascii ".*"
.byte 0
.byte 0
zproc print_fcb
lda param+0
ldx param+1
jsr printstring
jsr space
lda fcb_buffer+FCB_DR
ldx #0
jsr printi
jsr space
ldx #FCB_F1
zrepeat
txa
pha
lda fcb_buffer, x
jsr print1
jsr space
pla
inx
cpx #FCB_T3+1
zuntil_eq
jmp nl
zendproc
zproc nl
lda #13
jsr cpm_conout
lda #10
jmp cpm_conout
zendproc
zproc space
lda #' '
jmp cpm_conout
zendproc
zproc printstring
ldy #BDOS_WRITE_STRING
jmp BDOS
zendproc
zproc print1
pha
lsr a
lsr a
lsr a
lsr a
jsr print
pla
print:
and #0x0f
ora #48
cmp #58
zif_cs
adc #6
zendif
pha
jsr cpm_conout
pla
rts
zendproc
NOINIT
fcb_buffer: .fill FCB__SIZE