annotate level1/cmds/copy.asm @ 921:617c1b90e623

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