annotate level1/cmds/touch.asm @ 2798:b70d93f8d7ce lwtools-port

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