annotate level1/cmds/touch.asm @ 859:b35fcebc8581

Fixed a few bugs
author boisy
date Wed, 15 Jan 2003 02:45:07 +0000
parents 42a4f60582d8
children 617c1b90e623
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
1 ********************************************************************
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
2 * Touch - Changes last modification date/time
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
3 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
4 * $Id$
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
5 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
8 * 2 Rewrote touch from scratch, made almost 90% BGP 03/01/11
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
9 * smaller than C version found in the OS-9
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
10 * Development System
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
11
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
12 nam Touch
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
13 ttl Changes last modification date/time
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
14
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
15 ifp1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
16 use defsfile
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
17 use rbfdefs
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
18 endc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
19
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
20 * Here are some tweakable options
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
21 DOHELP set 1 1 = include help info
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
22 STCKSIZE set 64 our stack size in bytes
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
23 ZOPTSIZ set 64 max size of -z option's parameter
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
24
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
25 * Module header definitions
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
26 tylg set Prgrm+Objct
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
27 atrv set ReEnt+rev
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
28 rev set $01
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
29 edition set 2
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
30
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
31 mod eom,name,tylg,atrv,start,size
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
32
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
33 * Your utility's static storage vars go here
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
34 org 0
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
35 parmptr rmb 2 pointer to our command line params
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
36 bufptr rmb 2 pointer to user expandable buffer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
37 bufsiz rmb 2 size of user expandable buffer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
38 * What follows are utility specific options
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
39 nocreate rmb 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
40 quiterr rmb 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
41 filemode rmb 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
42 filecnt rmb 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
43 zoptflg rmb 1 1 = this option has been processed once already
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
44 zpath rmb 1 path to -z file
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
45 cleartop equ . everything up to here gets cleared at start
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
46 zopt rmb ZOPTSIZ buffer for what follows after -c=
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
47 * Next is a user adjustable buffer with # modifier on command line.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
48 * Some utilities won't need this, some will.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
49 * Currently set up to be larger for Level 2 than Level 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
50 * Note: this buffer must come just before the stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
51 IFGT Level-1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
52 bigbuff rmb 8*1024 8K default buffer for Level 2
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
53 ELSE
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
54 bigbuff rmb 512 512 byte default buffer for Level 1
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
55 ENDC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
56 * Finally the stack for any PSHS/PULS/BSR/LBSRs that we might do
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
57 stack rmb STCKSIZE
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
58 size equ .
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
59
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
60 * The utility name and edition goes here
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
61 name fcs /Touch/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
62 fcb edition
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
63
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
64 * Place constant strings here
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
65 IFNE DOHELP
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
66 HlpMsg fcb C$LF
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
67 fcc /Use: Touch [<opts>] <path> [<path>] [<opts>]/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
68 fcb C$LF
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
69 fcc / -c = don't create files/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
70 fcb C$LF
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
71 fcc / -q = don't quit on error/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
72 fcb C$LF
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
73 fcc / -x = search execution directory/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
74 fcb C$LF
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
75 fcc / -z = get files from standard input/
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
76 fcb C$LF
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
77 fcc / -z=<file> get files from <file>/
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
78 fcb C$LF
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
79 CR fcb C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
80 HlpMsgL equ *-HlpMsg
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
81 ENDC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
82 UnkOpt fcc /unknown option: /
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
83 UnkOptL equ *-UnkOpt
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
84 CantTch fcc /can't touch "/
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
85 CantTchL equ *-CantTch
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
86 EndCant fcc /" - /
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
87 EndCantL equ *-EndCant
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
88
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
89 * Here's how registers are set when this process is forked:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
90 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
91 * +-----------------+ <-- Y (highest address)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
92 * ! Parameter !
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
93 * ! Area !
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
94 * +-----------------+ <-- X, SP
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
95 * ! Data Area !
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
96 * +-----------------+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
97 * ! Direct Page !
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
98 * +-----------------+ <-- U, DP (lowest address)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
99 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
100 * D = parameter area size
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
101 * PC = module entry point abs. address
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
102 * CC = F=0, I=0, others undefined
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
103
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
104 * The start of the program is here.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
105 * Before any command line processing is done, we clear out
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
106 * our static memory from U to cleartop, then determine the
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
107 * size of our data area (minus the stack).
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
108 start pshs u,x save registers for later
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
109 leax <cleartop,u point to end of area to zero out
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
110 IFNE H6309
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
111 subr u,x subtract U from X
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
112 tfr x,w and put X in W
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
113 clr ,-s put a zero on the stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
114 tfm s,u+ and use TFM to clear starting at U
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
115 leas 1,s clean up the stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
116 ELSE
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
117 pshs x save end pointer on stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
118 clrnxt clr ,u+ clear out
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
119 cmpu ,s done?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
120 bne clrnxt branch if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
121 leas 2,s else clear stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
122 ENDC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
123 puls x,u and restore our earlier saved registers
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
124 leay bigbuff,u point Y to copy buffer offset in U
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
125 stx <parmptr save parameter pointer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
126 sty <bufptr save pointer to buffer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
127 tfr s,d place top of stack in D
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
128 IFNE H6309
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
129 subr y,d
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
130 ELSE
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
131 pshs y save Y on stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
132 subd ,s++ get size of space between copybuf and X
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
133 ENDC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
134 subd #STCKSIZE subtract out our stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
135 std <bufsiz size of our buffer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
136
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
137 * At this point we have determined our buffer space and saved pointers
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
138 * for later use. Now we will parse the command line for options that
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
139 * begin with -
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
140 lda ,x
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
141 cmpa #C$CR CR?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
142 lbeq ShowHelp if so, no parameters... show help and exit
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
143 GetChar lda ,x+ get next character on cmd line
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
144 cmpa #C$CR CR?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
145 lbeq DoTouch if so, do whatever this utility does
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
146 cmpa #'- is it an option?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
147 beq GetDash if so, process it
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
148 inc <filecnt else must be a non-option argument (file)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
149 lbsr SkipNSpc move past the argument
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
150 ChkDash lbsr SkipSpcs and any following spaces
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
151 bra GetChar start processing again
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
152 GetDash lda #C$SPAC get a space char
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
153 sta -1,x and wipe out the dash from the cmd line
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
154 GetDash2 ldd ,x+ load option char and char following
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
155 ora #$20 make lowercase
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
156 IsItC cmpa #'c is it this option?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
157 bne IsItQ branch if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
158 sta <nocreate
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
159 lbra FixCmdLn
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
160 IsItQ cmpa #'q is it this option?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
161 bne IsItX branch if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
162 inc <quiterr
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
163 lbra FixCmdLn
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
164 IsItX cmpa #'x is it this option?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
165 bne IsItZ branch if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
166 lda #EXEC.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
167 sta <filemode
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
168 bra FixCmdLn
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
169 IsItZ cmpa #'z is it this option?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
170 bne BadOpt branch if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
171 tst <zoptflg was this option already specified?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
172 bne BadOpt show help if so
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
173 sta <zoptflg else tag this option as parsed
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
174 cmpb #'= 2nd char =?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
175 bne FixCmdLn
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
176 GetZFile ldb #C$SPAC get space
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
177 stb -$01,x write over c
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
178 stb ,x+ and = sign, inc X to dest dir
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
179 * check for valid char after -z=
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
180 lda ,x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
181 cmpa #C$SPAC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
182 lbeq ShowHelp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
183 cmpa #C$COMA
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
184 lbeq ShowHelp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
185 cmpa #C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
186 lbeq ShowHelp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
187 leay <zopt,u point Y to parameber buffer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
188 tfr y,d transfer Y to D
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
189 addd #ZOPTSIZ
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
190 pshs b,a save updated ptr value
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
191 ldb #C$SPAC get space
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
192 L0339 lda ,x get byte at X
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
193 stb ,x+ store space at X and inc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
194 sta ,y+ save loaded byte at Y and inc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
195 cmpy ,s are we at end?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
196 beq L035D branch if so (buffer too small)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
197 cmpa #C$SPAC else is char in A a space?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
198 beq L0350 branch if so
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
199 cmpa #C$COMA coma?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
200 beq L0350 branch if so
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
201 cmpa #C$CR cr?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
202 bne L0339 get next byte if not
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
203 L0350 leax -1,x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
204 sta ,x restore previous A
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
205 leas $02,s kill stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
206 * attempt to open a path to the file
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
207 pshs x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
208 leax <zopt,u
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
209 lda #READ.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
210 os9 I$Open
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
211 lbcs Exit
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
212 sta <zpath
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
213 puls x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
214 lbra ChkDash
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
215 L035D leas $02,s
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
216 ldb #$BF else buffer size too small
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
217 orcc #Carry
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
218 lbra Exit
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
219 FixCmdLn lda #C$SPAC get space
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
220 sta -$01,x and wipe out option character
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
221 cmpb #'0
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
222 lblt ChkDash start dash option processing again
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
223 lbra GetDash possibly another option following?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
224
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
225 * We branch here if we encounter an unknown option character
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
226 * A = bad option character
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
227 BadOpt leax UnkOpt,pcr
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
228 ldy #UnkOptL
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
229 ldb #C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
230 pshs d save bad option and CR on stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
231 lda #$02 stderr
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
232 os9 I$Write
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
233 leax ,s point X at option char on stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
234 os9 I$WritLn print option and CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
235 puls d clean up stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
236 lbra ShowHelp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
237
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
238
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
239 * At this point options are processed.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
240 * We load X with our parameter pointer and go down the command line
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
241 * looking at each file to process (options have been wiped out with
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
242 * spaces)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
243 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
244 * Note, the following two instructions may not be needed, depending on
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
245 * if your utility requires a non-option on the command line.
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
246 DoTouch tst <zoptflg -z specified?
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
247 beq DoFiles no, do any files on command line
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
248 ReadZ lda <zpath
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
249 ldy #80
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
250 os9 I$ReadLn
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
251 lbsr SkipSpcs
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
252 cmpa #C$CR
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
253 beq ClosEx
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
254 bcs TestErr
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
255 bsr ProcFile
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
256 bra ReadZ
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
257 TestErr cmpb #E$EOF
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
258 lbne Exit
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
259 tsta
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
260 lbeq ExitOk
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
261 ClosEx os9 I$Close close path to -z= file
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
262 lbra ExitOk
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
263
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
264 DoFiles tst <filecnt we should have at least one file on cmdline
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
265 lbeq ShowHelp if not, exit with error
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
266 ldx <parmptr get our parameter pointer off stack
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
267 DoLoop lbsr SkipSpcs skip any leading spaces
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
268 cmpa #C$CR end of parameters?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
269 beq ExitOk if so, end the utility
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
270 pshs x save pointer to arg
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
271 bsr ProcFile process file at X
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
272 puls x get arg pointer
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
273 lbsr SkipNSpc skip the argument we just processed
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
274 bra DoLoop
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
275
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
276 * This routine processes one file at a time.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
277 * Entry: X = ptr to argument on the command line.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
278 * On exit, X can point to the argument or past it.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
279 * Note that there are NO leading spaces.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
280 * They have been skipped by the caller.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
281 * The following code just echos the command line argument, followed
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
282 * by a carriage return.
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
283 ProcFile
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
284 lda #WRITE.
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
285 ora <filemode
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
286 pshs x
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
287 os9 I$Open
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
288 puls x
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
289 bcc CloseIt
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
290 ora #DIR.
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
291 pshs x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
292 os9 I$Open
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
293 puls x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
294 bcc CloseIt
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
295 * open failed... should we do create?
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
296 tst <nocreate
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
297 beq DoCreate
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
298 ChkQuit bsr CantTouch
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
299 tst <quiterr
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
300 beq ExitOK
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
301 bra ProcRTS
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
302 DoCreate ldb #PREAD.+UPDAT.
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
303 pshs x
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
304 os9 I$Create
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
305 puls x
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
306 bcs ChkQuit
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
307 CloseIt os9 I$Close
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
308 ProcRTS rts
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
309
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
310 CantTouch
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
311 pshs x,b save pointer to file and error code
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
312 leax CantTch,pcr
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
313 lda #$02
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
314 ldy #CantTchL
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
315 os9 I$Write
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
316 ldx 1,s
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
317 pshs x
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
318 bsr StrLen
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
319 puls x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
320 os9 I$Write
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
321 leax EndCant,pcr
859
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
322 ldy #EndCantL
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
323 os9 I$Write
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
324 puls b
b35fcebc8581 Fixed a few bugs
boisy
parents: 852
diff changeset
325 os9 F$PErr
852
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
326 puls x,pc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
327
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
328 ShowHelp equ *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
329 IFNE DOHELP
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
330 leax >HlpMsg,pcr point to help message
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
331 ldy #HlpMsgL get length
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
332 lda #$02 std error
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
333 os9 I$WritLn write it
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
334 ENDC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
335 ExitOk clrb clear carry
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
336 Exit os9 F$Exit and exit
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
337
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
338 * This routine counts the number of non-whitespace characters
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
339 * starting at X
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
340 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
341 * Entry:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
342 * X = ptr to string (space, comma or CR terminated)
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
343 * Exit:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
344 * Y = length of string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
345 * X = ptr to byte after string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
346 StrLen pshs a
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
347 ldy #$0000
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
348 StrLenLp lda ,x+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
349 cmpa #C$SPAC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
350 beq StrLenEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
351 cmpa #C$COMA
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
352 beq StrLenEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
353 cmpa #C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
354 beq StrLenEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
355 leay 1,y
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
356 bra StrLenLp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
357 StrLenEx puls a,pc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
358
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
359 * This routine copies a string of text from X to Y until
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
360 * a whitespace character or CR is encountered
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
361 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
362 * Entry:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
363 * X = ptr to src string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
364 * Y = ptr to dest string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
365 * Exit:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
366 * D = number of bytes copied
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
367 * X = ptr to byte after original string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
368 * Y = ptr to byte after copied string
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
369 StrCpy pshs u
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
370 ldu #$0000
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
371 CopyFnLp lda ,x+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
372 cmpa #C$SPAC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
373 beq CopyFnEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
374 cmpa #C$COMA
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
375 beq CopyFnEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
376 cmpa #C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
377 beq CopyFnEx
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
378 sta ,y+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
379 leau 1,u
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
380 bra CopyFnLp
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
381 CopyFnEx tfr u,d
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
382 puls u,pc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
383
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
384 * This routine skip over spaces and commas
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
385 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
386 * Entry:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
387 * X = ptr to data to parse
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
388 * Exit:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
389 * X = ptr to first non-whitespace char
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
390 * A = non-whitespace char
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
391 SkipSpcs lda ,x+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
392 cmpa #C$SPAC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
393 beq SkipSpcs
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
394 cmpa #C$COMA
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
395 beq SkipSpcs
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
396 leax -1,x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
397 rts
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
398
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
399 * This routine skips over everything but spaces, commas and CRs
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
400 *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
401 * Entry:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
402 * X = ptr to data to parse
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
403 * Exit:
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
404 * X = ptr to first whitespace char
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
405 * A = whitespace char
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
406 SkipNSpc lda ,x+
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
407 cmpa #C$SPAC
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
408 beq EatOut
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
409 cmpa #C$COMA
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
410 beq EatOut
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
411 cmpa #C$CR
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
412 bne SkipNSpc
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
413 EatOut leax -1,x
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
414 rts
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
415
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
416 emod
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
417 eom equ *
42a4f60582d8 Start of assembly touch utility -- still needs work
boisy
parents:
diff changeset
418 end