annotate level1/cmds/copy.asm @ 1020:c1a5613ffe7b

changes
author boisy
date Thu, 06 Mar 2003 01:41:03 +0000
parents c04528763543
children 84ea83668304
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
2 * Copy - File copy utility
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
8 * 9 From Tandy OS-9 Level One VR 02.00.00
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
9 * 10 Reworked RML
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
10 * 11 Added useful options, made more robust BGP 03/01/11
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 nam Copy
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
13 ttl File copy utility
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
15 ifp1
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
16 use defsfile
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
17 use rbfdefs
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
18 endc
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
19
921
617c1b90e623 Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents: 846
diff changeset
20 DOHELP set 0
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
21
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
22 tylg set Prgrm+Objct
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 rev set $01
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
25 edition set 11
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
26
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 mod eom,name,tylg,atrv,start,size
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
28
929
c04528763543 stack/parameter size increased to prevent collisions with memory
boisy
parents: 921
diff changeset
29 STACKSZ equ 128 estimated stack size
c04528763543 stack/parameter size increased to prevent collisions with memory
boisy
parents: 921
diff changeset
30 PARMSZ equ 256 estimated parameter size
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
31 DDIRBSIZ equ 64 destination directory buffer size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
32
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
33 org 0
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
34 rdbufptr rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
35 parmptr rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
36 srcpath rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
37 dstpath rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
38 devtyp rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
39 bufsiz rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
40 srcflsiz rmb 4
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
41 abortflg rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
42 quiet rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
43 single rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
44 rewrite rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
45 filecnt rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
46 srccnt rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
47 srcmode rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
48 wopt rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
49 srcfname rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
50 dstfptr rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
51 wfileptr rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
52 wfilelen rmb 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
53 lstfopen rmb 2 pointer to name of last file attempted open
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
54 lstfopln rmb 2 length of last file atteppted open
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
55 srcattr rmb 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
56 fdbufcpy rmb 16
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
57 optbuf rmb 32
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
58 wdest rmb DDIRBSIZ portion after '-w='
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
59 rmb DDIRBSIZ additional space
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
60 * Note: copy buffer must come just before the stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
61 IFGT Level-1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
62 copybuff rmb 8*1024 8K default buffer for Level 2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
63 ELSE
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
64 copybuff rmb 512 512 byte default buffer for Level 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
65 ENDC
929
c04528763543 stack/parameter size increased to prevent collisions with memory
boisy
parents: 921
diff changeset
66 rmb STACKSZ+PARMSZ
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 size equ .
200
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 188
diff changeset
68
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 188
diff changeset
69 name fcs /Copy/
e9ce43cc215e Made major changes to headers for consistency and identification
boisy
parents: 188
diff changeset
70 fcb edition
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
71
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
72 SrcPmpt fcc /Ready SOURCE, hit C to continue: /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
73 SrcPmptL equ *-SrcPmpt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
74 DstPmpt fcc /Ready DESTINATION, hit C to continue: /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
75 DstPmptL equ *-DstPmpt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
76 CrRtn fcb C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
77 IFNE DOHELP
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
78 HlpMsg fcb C$LF
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
79 fcc /Use: Copy [<opts>] <srcpath> [<dstpath>] [<opts>]/
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
80 fcb C$LF
841
d5c84431e734 Shrank help a bit more to reduce size
boisy
parents: 823
diff changeset
81 fcc / -a = abort on error/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
82 fcb C$LF
841
d5c84431e734 Shrank help a bit more to reduce size
boisy
parents: 823
diff changeset
83 fcc / -p = don't print files copied (use with -w)/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
84 fcb C$LF
841
d5c84431e734 Shrank help a bit more to reduce size
boisy
parents: 823
diff changeset
85 fcc / -r = rewrite destination/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
86 fcb C$LF
841
d5c84431e734 Shrank help a bit more to reduce size
boisy
parents: 823
diff changeset
87 fcc / -s = single drive copy/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
88 fcb C$LF
846
c6e6cf68e03e Optimized
boisy
parents: 841
diff changeset
89 fcc / -w=<dir> = copy to <dir>/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
90 fcb C$LF
841
d5c84431e734 Shrank help a bit more to reduce size
boisy
parents: 823
diff changeset
91 fcc / -x = copy from exec dir/
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
92 fcb C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
93 HlpMsgL equ *-HlpMsg
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
94 ENDC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
95 PLIncmp fcc /copy: destination must be complete pathlist/
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
96 fcb C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
97 TooMany fcc /copy: must specify output directory if more than 2 files/
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
98 fcb C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
99 Copying fcc /copying /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
100 CopyingL equ *-Copying
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
101 CopyTo fcc / to /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
102 CopyToL equ *-CopyTo
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
103 Cont fcc !Continue (y/n) ?!
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
104 ContL equ *-Cont
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
105 CantCpy fcc /copy: can't open /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
106 CantCpyL equ *-CantCpy
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
107 SpcDsh fcc / - /
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
108 SpcDshL equ *-SpcDsh
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
109
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
110 * +-----------------+ <-- Y (highest address)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
111 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
112 * ! Parameter !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
113 * ! Area !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
114 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
115 * +-----------------+ <-- X, SP
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
116 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
117 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
118 * ! Data Area !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
119 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
120 * ! !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
121 * +-----------------+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
122 * ! Direct Page !
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
123 * +-----------------+ <-- U, DP (lowest address)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
124 *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
125 * D = parameter area size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
126 * PC = module entry point abs. address
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
127 * CC = F=0, I=0, others undefined
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
128
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
129 start pshs u,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
130 leax <wdest,u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
131 pshs x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
132 clrnxt clr ,u+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
133 cmpu ,s
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
134 bne clrnxt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
135 leas 2,s
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
136 puls x,u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
137 leay copybuff,u point Y to copy buffer offset in U
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
138 stx <parmptr save parameter pointer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
139 sty <rdbufptr save pointer to buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
140 tfr s,d place top of stack in D
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
141 pshs y save Y on stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
142 subd ,s++ get size of space between copybuf and X
929
c04528763543 stack/parameter size increased to prevent collisions with memory
boisy
parents: 921
diff changeset
143 subd #STACKSZ+PARMSZ subtract out our stack
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
144 std <bufsiz size of our buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
145 lbsr SkipSpcs move past any spaces on command line
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
146 cmpa #C$CR CR?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
147 lbeq ShowHelp if so, show help
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
148 GetNChr lda ,x+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
149 cmpa #C$CR CR?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
150 lbeq CpyFiles branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
151 cmpa #'- option?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
152 beq GetDash
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
153 inc <filecnt must be a file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
154 lbsr SkipNSpc else go past non-spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
155 ChkDash lbsr SkipSpcs and any following spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
156 bra GetNChr and check for Cr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
157 GetDash lda #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
158 sta -1,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
159 GetDash2 ldd ,x+ load option char and char following
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
160 anda #$5F
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
161 cmpa #'S single drive copy?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
162 bne IsItA branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
163 inc <single
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
164 lbra FixCmdLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
165 IsItA cmpa #'A abort option?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
166 bne IsItP branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
167 inc <abortflg
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
168 bra FixCmdLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
169 IsItP cmpa #'P supress output?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
170 bne IsItX branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
171 inc <quiet
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
172 bra FixCmdLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
173 IsItX cmpa #'X execution dir?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
174 bne IsItW branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
175 lda #EXEC. else get EXEC.
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
176 sta <srcmode and save as source mode
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
177 bra FixCmdLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
178 IsItW cmpa #'W directory specification?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
179 bne IsItR branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
180 tst <wopt already specified?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
181 bne BadOpt show help if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
182 cmpb #'= 2nd char =?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
183 bne BadOpt show help if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
184 inc <wopt else tag wopt as specified
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
185 ldb #C$SPAC get space
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
186 stb -$01,x write over w
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
187 stb ,x+ and = sign, inc X to dest dir
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
188 * check for valid char after -w=
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
189 lda ,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
190 cmpa #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
191 lbeq ShowHelp
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
192 cmpa #C$COMA
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
193 lbeq ShowHelp
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
194 cmpa #C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
195 lbeq ShowHelp
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
196 leay <wdest,u point Y to parameber buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
197 sty <dstfptr save pointer to destination file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
198 tfr y,d transfer Y to D
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
199 addd #DDIRBSIZ add size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
200 pshs b,a save updated ptr value
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
201 ldb #C$SPAC get space
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
202 L0339 lda ,x get byte at X
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
203 stb ,x+ store space at X and inc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
204 sta ,y+ save loaded byte at Y and inc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
205 cmpy ,s are we at end?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
206 beq L035D branch if so (buffer too small)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
207 cmpa #C$SPAC else is char in A a space?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
208 beq L0350 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
209 cmpa #C$COMA coma?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
210 beq L0350 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
211 cmpa #C$CR cr?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
212 bne L0339 get next byte if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
213 L0350 leax -1,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
214 sta ,x restore previous A
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
215 lda #PDELIM get pathlist delimiter
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
216 sta -$01,y save slash at end (for building path later)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
217 sty <wfileptr save pointer for -w pathlist file copying
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
218 leas $02,s kill stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
219 lbra ChkDash
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
220 L035D leas $02,s
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
221 ldb #$BF else buffer size too small
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
222 orcc #Carry
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
223 lbra Exit
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
224 IsItR cmpa #'R rewrite?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
225 bne BadOpt branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
226 inc <rewrite
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
227 FixCmdLn lda #C$SPAC get space
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
228 sta -$01,x and wipe out option character
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
229 cmpb #'0
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
230 lblt ChkDash start dash option processing again
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
231 lbra GetDash possibly another option following?
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
232
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
233 BadOpt puls x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
234 lbra ShowHelp
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
235
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
236 CopyToW ldx <srcfname get ptr to next file to process
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
237 * In case the source file name has a / in it (i.e. /dd/x/y/fname),
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
238 * we go past the file and then back up to either the first / we
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
239 * encounter, or a space (be sure we don't go past parmptr)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
240 lda ,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
241 cmpa #C$CR carriage return?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
242 lbeq ExitOk yep, no more files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
243 lbsr SkipNSpc skip over filename
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
244 * X points to first char after file name (space, comma or CR)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
245 L038B cmpx <parmptr are we at start of command line?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
246 beq PlugIt2 if so, we can't go further back
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
247 lda ,-x get byte
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
248 cmpa #PDELIM path delimiter?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
249 beq PlugIt branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
250 cmpa #C$SPAC space?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
251 beq PlugIt branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
252 cmpa #C$COMA comma?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
253 beq PlugIt branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
254 bra L038B else get next char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
255 PlugIt leax 1,x go forward 1
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
256 PlugIt2 ldy <wfileptr get address past xxxx/ (specified by -w=)
823
357c62d55b8f Changes
boisy
parents: 812
diff changeset
257 lbsr StrCpy copy filename
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
258 std <wfilelen save file length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
259 lda #C$CR get CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
260 sta ,y and terminate
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
261 * ldx <wopt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
262 * stx <wfileptr
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
263 rts
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
264
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
265 * At this point options are processed, so we need to start copying files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
266 CpyFiles tst <filecnt we should have at least one file on cmdline
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
267 lbeq ShowHelp if not, exit with error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
268 ldx <parmptr get our parameter pointer off stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
269 lbsr SkipSpcs skip any leading spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
270 tst <wopt -w specified?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
271 beq L03C5 branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
272 stx <srcfname else save start of parameter pointer as next file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
273 clr <single no single option with -w
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
274 L03BE bsr CopyToW copy file at <srcfname to -w buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
275 bra OpenSrc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
276 * This code handles single file copy (i.e. copy file1 file2)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
277 * or a single disk copy (i.e. copy -s abc)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
278 L03C5 lbsr GetSDFl else get source/destination files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
279 bcc L03D4 branch if we got both ok
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
280 tst <single is this a single drive copy?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
281 lbne PListErr if not, user didn't specify enough files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
282 lbcs Exit if error, exit
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
283 * test for right number of files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
284 L03D4 lda <filecnt get total file count
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
285 cmpa #2 should be no more than two files
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
286 ble OpenSrc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
287 leax TooMany,pcr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
288 lbsr WrLine
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
289 lbra ExitOk
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
290 OpenSrc ldx <srcfname get file to open
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
291 pshs x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
292 lbsr StrLen get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
293 std <lstfopln save length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
294 puls x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
295 lda #READ. read mode
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
296 ora <srcmode or in any additional modes (i.e. EXEC.)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
297 stx <lstfopen save pointer to last file open var
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
298 os9 I$Open open source file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
299 bcc L03FA branch if open ok
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
300 cmpx <srcfname did open go past pathlist?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
301 bne OpenFail branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
302 lbsr SkipNSpc else skip over failed filename
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
303 lbsr SkipSpcs and any trailing spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
304 OpenFail stx <srcfname save updated pathlist pointer (points to next file on cmd line)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
305 lbra ShutDown
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
306 L03FA sta <srcpath save source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
307 pshs a save path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
308 lbsr SkipSpcs destroy any leading spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
309 stx <srcfname and save pointer to next source filename
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
310 lbsr StrLen get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
311 std <lstfopln save length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
312 puls a get path off stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
313 leax <fdbufcpy,u point to FD buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
314 ldy #FD.SEG number of bytes
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
315 ldb #SS.FD
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
316 os9 I$GetStt get file's file descriptor
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
317 bcs L041B branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
318 tst <single single drive copy?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
319 beq L041B branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
320 lda [<dstfptr,u] get first char of destination filename
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
321 ldb #E$BPNam prepare for possible error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
322 cmpa #PDELIM path has leading slash?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
323 lbne PListErr if not, show error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
324 L041B lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
325 leax <optbuf,u point to options buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
326 clrb was: ldb #SS.Opt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
327 os9 I$GetStt get path options
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
328 lbcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
329 lda ,x get device type
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
330 sta <devtyp save
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
331 ldb #$0F
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
332 cmpa #DT.RBF rbf device?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
333 bne L0449 branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
334 pshs u,x save regs
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
335 lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
336 ldb #SS.Size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
337 os9 I$GetStt get size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
338 lbcs ShutDown
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
339 stx <srcflsiz save file size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
340 stu <srcflsiz+2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
341 puls u,x restore regs
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
342 ldb <PD.ATT-PD.OPT,x get source file's attributes
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
343 L0449 stb <srcattr save
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
344 lda #$01
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
345 lbsr SwapDsk check for single disk copy and prompt if necessary
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
346 L0450 ldx <dstfptr point to destination file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
347 pshs x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
348 lbsr StrLen get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
349 std <lstfopln save length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
350 puls x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
351 lda #WRITE. write mode
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
352 ldb <srcattr get source attributes
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
353 stx <lstfopen
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
354 os9 I$Create create file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
355 bcc L048B branch if create ok
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
356 tst <rewrite rewrite flag set?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
357 lbeq ShutDown branch if no
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
358 cmpb #E$CEF file already exists?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
359 lbne ShutDown branch if any other error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
360 L047A os9 I$Delete delete file first
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
361 lbcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
362 bra L0450 else try opening again
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
363 L048B sta <dstpath save destination path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
364 tst <wopt w option specified?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
365 beq GetOpts branch iff not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
366 tst <quiet p option specified?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
367 bne GetOpts branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
368 pshs a else save dest path on stack
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
369 leax >Copying,pcr else print 'Copying...'
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
370 ldy #CopyingL
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
371 lbsr WritSOut write it to stdout
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
372 ldx <wfileptr get pointer to file being copied
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
373 ldy <wfilelen get file name length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
374 lbsr WritSOut print file name
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
375 leax >CopyTo,pcr print ' to '
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
376 ldy #CopyToL
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
377 lbsr WritSOut write it to stdout
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
378 ldx <dstfptr get pointer to file being copied
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
379 lbsr WrLine print file with CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
380 puls a restore dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
381 GetOpts leax <optbuf,u point to option buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
382 clrb was: ldb #SS.Opt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
383 os9 I$GetStt get options
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
384 lbcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
385 ldb ,x get device type
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
386 cmpb #DT.RBF rbf?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
387 bne CopyLoop if not rbf device, don't get file size or fd seg
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
388 L04B4 lda <devtyp get device type
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
389 cmpa #DT.RBF rbf?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
390 bne CopyLoop branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
391 pshs u save our statics ptr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
392 lda <dstpath else get dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
393 ldb #SS.Size and setstat option
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
394 ldx <srcflsiz get file size of source
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
395 ldu <srcflsiz+2
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
396 os9 I$SetStt and set dest file to same size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
397 lbcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
398 puls u restore U
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
399 lda <dstpath get dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
400 leax <fdbufcpy,u point to file desc. buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
401 ldy #FD.SEG get size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
402 ldb #SS.FD
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
403 os9 I$SetStt write src fd seg to dest file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
404 * Copy loop is here
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
405 CopyLoop ldx <rdbufptr get ptr to read buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
406 clra A = 0 = source prompt if needed
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
407 lbsr SwapDsk check for single disk copy and prompt if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
408 lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
409 ldy <bufsiz get buffer size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
410 os9 I$Read read it!
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
411 bcs L0558 branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
412 lda #$01 A = 1 = dest prompt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
413 lbsr SwapDsk check for single disk copy and prompt if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
414 lda <dstpath get dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
415 os9 I$Write write it out!
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
416 lbcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
417 lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
418 ldb #SS.EOF
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
419 os9 I$GetStt are we at end of file?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
420 bcc CopyLoop branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
421 cmpb #E$EOF end of file error?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
422 beq L0561 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
423 L0558 cmpb #E$EOF end of file rror?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
424 bne ShutDown branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
425 lda #$01 prompt destination flag
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
426 lbsr SwapDsk check for single drive copy and prompt if necessary
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
427 L0561 lda <dstpath get destination path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
428 os9 I$Close close that file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
429 bcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
430 clr <dstpath else clear dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
431 lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
432 os9 I$Close close it
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
433 bcs ShutDown branch if error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
434 clr <srcpath clear src path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
435 tst <wopt -w specified
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
436 lbeq ExitOk branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
437 lbra L03BE
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
438
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
439 * Entry: X = ptr to data to write, Y = length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
440 WritSOut lda #$01 standard out
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
441 os9 I$Write write it
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 rts
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
443
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
444 PListErr leax >PLIncmp,pcr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
445 bsr WrLine
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
446 bra ExitOk
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
447
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
448 ShutDown pshs b
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
449 lda <srcpath get source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
450 beq L05AA branch if none
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
451 os9 I$Close close it
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
452 L05AA lda <dstpath get dest path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
453 beq L05B1 branch if none
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
454 os9 I$Close close it
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
455 L05B1 clr <srcpath clear source path
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
456 clr <dstpath and destination
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
457 leax >CantCpy,pcr else show can't copy error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
458 ldy #CantCpyL
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
459 bsr WritSOut write out
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
460 ldx <lstfopen show filename that failed
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
461 ldy <lstfopln get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
462 bsr WritSOut
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
463 leax >SpcDsh,pcr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
464 ldy #SpcDshL
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
465 bsr WritSOut write out
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
466 puls b
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
467 PrintErr os9 F$PErr print error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
468 tst <wopt -w used?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
469 beq ExitOk branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
470 tst <abortflg abort flag set?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
471 bne ExitOk branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
472 AskAgain leax >Cont,pcr point to continue prompt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
473 ldy #ContL get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
474 bsr WritSOut write
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
475 clra ADDED +BGP+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
476 ldx <rdbufptr get pointer at readbuf
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
477 ldy #$0002 2 bytes
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
478 os9 I$ReadLn read form stdin
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
479 lda ,x get byte at X
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
480 anda #$5F
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
481 cmpa #'Y user wants to continue?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
482 lbeq L03BE branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
483 cmpa #'N no?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
484 beq ExitOk branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
485 bra AskAgain else ask again
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
486
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
487 ShowHelp equ *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
488 IFNE DOHELP
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
489 leax >HlpMsg,pcr point to help message
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
490 ldy #HlpMsgL get length
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
491 lda #$02 std error
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
492 os9 I$WritLn write it
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
493 ENDC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
494 ExitOk clrb clear carry
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
495 Exit os9 F$Exit and exit
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
496
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
497 * Write line passed in X
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
498 WrLine ldy #$00A0
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
499 WrNBytes lda #$01
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
500 os9 I$WritLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
501 rts
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
502
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
503 * Prompt User for Source or Destination Disk
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
504 SwapDsk tst <single single disk copy?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
505 beq NoSwap branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
506 pshs y,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
507 L0626 pshs a
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
508 tsta
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
509 bne L0635
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
510 leax >SrcPmpt,pcr point to source prompt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
511 ldy #SrcPmptL get size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
512 bra L063D write it and get input
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
513 L0635 leax >DstPmpt,pcr point to dest prompt
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
514 ldy #DstPmptL get size
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
515 L063D bsr WrNBytes write it
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
516 leax ,-s point to stack for temp buffer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
517 ldy #$0001 one byte
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
518 clra from std in
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
519 os9 I$Read read byte from user
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
520 lda ,s+ get char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
521 eora #'C
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
522 anda #$DF
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
523 beq L0657 branch if C
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
524 bsr L065E
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
525 puls a
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
526 bne L0626
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
527 L0657 bsr L065E
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
528 puls a
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
529 puls y,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
530 NoSwap rts
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
531 L065E pshs y,x,a
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
532 lda #$01
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
533 leax >CrRtn,pcr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
534 ldy #80
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
535 os9 I$WritLn
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
536 puls pc,y,x,a
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
537
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
538 * StrLen
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
539 *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
540 * Entry:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
541 * X = ptr to string (space, comma or CR terminated)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
542 * Exit:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
543 * D = length of string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
544 * X = ptr to byte after string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
545 StrLen pshs u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
546 ldu #$0000
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
547 StrLenLp lda ,x+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
548 cmpa #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
549 beq StrLenEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
550 cmpa #C$COMA
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
551 beq StrLenEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
552 cmpa #C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
553 beq StrLenEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
554 leau 1,u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
555 bra StrLenLp
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
556 StrLenEx tfr u,d
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
557 puls u,pc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
558
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
559 * StrCpy
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
560 *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
561 * Entry:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
562 * X = ptr to src string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
563 * Y = ptr to dest string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
564 * Exit:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
565 * D = number of bytes copied
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
566 * X = ptr to byte after original string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
567 * X = ptr to byte after copied string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
568 StrCpy pshs u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
569 ldu #$0000
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
570 CopyFnLp lda ,x+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
571 cmpa #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
572 beq CopyFnEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
573 cmpa #C$COMA
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
574 beq CopyFnEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
575 cmpa #C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
576 beq CopyFnEx
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
577 sta ,y+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
578 leau 1,u
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
579 bra CopyFnLp
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
580 CopyFnEx tfr u,d
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
581 puls u,pc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
582
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
583 * Skip over spaces and commas
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
584 *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
585 * Entry:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
586 * X = ptr to string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
587 * Exit:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
588 * X = ptr to first non-whitespace char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
589 * A = non-whitespace char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
590 SkipSpcs lda ,x+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
591 cmpa #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
592 beq SkipSpcs
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
593 cmpa #C$COMA
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
594 beq SkipSpcs
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
595 leax -1,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
596 rts
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
597
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
598 * Skip over non-spaces and non-commas
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
599 *
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
600 * Entry:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
601 * X = ptr to string
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
602 * Exit:
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
603 * X = ptr to first non-whitespace char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
604 * A = non-whitespace char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
605 SkipNSpc lda ,x+
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
606 cmpa #C$SPAC
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
607 beq EatOut
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
608 cmpa #C$COMA
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
609 beq EatOut
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
610 cmpa #C$CR
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
611 bne SkipNSpc
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
612 EatOut leax -1,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
613 rts
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
614
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
615 * Get source file in <srcfname and destination file in <dstfptr
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
616 GetSDFl leay <srcfname,u point X to next file pointer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
617 bsr SrchFile skip white spaces, look for name on cmd line
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
618 bcs L067D branch if end
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
619 inc <srccnt else increment souce count
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
620 leay <dstfptr,u point Y to destination file
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
621 bsr SkipSpcs destroy any leading spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
622 bsr SrchFile skip white spaces, look for name on cmd line
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
623 L067D rts
662
1810b051d07e copy, display and makdir are now improved versions with enhanced
boisy
parents: 200
diff changeset
624
802
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
625 * Starting at X, parse for a filename, skipping leading white spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
626 SrchFile lda ,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
627 cmpa #C$CR CR?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
628 beq L06A2 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
629 stx ,y else store X at Y
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
630 SkipFile bsr SkipNSpc skip non-spaces
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
631 ParseOk clrb clear B
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
632 rts return
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
633 L06A2 tst <srccnt any file specified?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
634 bne L06AA branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
635 BadPName ldb #E$BPNam else no source was specified
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
636 coma
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
637 rts
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
638
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
639 L06AA ldx <srcfname get pointer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
640 L06AC lda ,x+ get char
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
641 cmpa #C$SPAC space?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
642 beq L06C4 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
643 cmpa #C$COMA comma?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
644 beq L06C4 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
645 cmpa #C$CR carriage return?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
646 beq L06C4 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
647 cmpa #PDELIM pathlist delimiter?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
648 bne L06AC branch if not
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
649 clr <srccnt else clear file count
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
650 stx ,y and store
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
651 bra L06AC continue parsing
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
652 L06C4 tst <srccnt file count 0?
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
653 beq L06D2 branch if so
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
654 tst <srcmode source mode? (exec or data dir)
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
655 beq BadPName branch if data
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
656 ldx <srcfname else get pointer
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
657 stx ,y save
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
658 bra ParseOk branch
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
659 L06D2 lda -$02,x
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
660 cmpa #PDELIM
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
661 beq BadPName
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
662 bra ParseOk
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
663
3a308921e135 New version of copy with OSK like features
boisy
parents: 662
diff changeset
664 emod
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
665 eom equ *
15
0912ac5dc2ff Added initial and dates to some source files
boisy
parents: 0
diff changeset
666 end