annotate level1/cmds/shellplus.asm @ 2954:43588191b624

rules.mak: Generate assembly listings if LISTDIR is defined This is useful for debugging.
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 08 Feb 2014 02:12:13 +0100 (2014-02-08)
parents 5c6b71612ce4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1 ********************************************************************
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2 * Shellplus - Enhanced shell for NitrOS-9
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3 *
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
4 * Modified by L. Curtis Boyle from original 2.2 disassembly
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
5 *
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
6 * $Id$
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
7 *
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
8 * Edt/Rev YYYY/MM/DD Modified by
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
9 * Comment
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
10 * ------------------------------------------------------------------
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
11 * 21 ????/??/??
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
12 * Original Tandy/Microware version.
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
13 *
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
14 * 22/2 ????/??/??
bf6f854a4299 Changed revisions to 0
boisy
parents: 714
diff changeset
15 * History and numerous features added.
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
16 *
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
17 * 23 2010/01/19 Boisy G. Pitre
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2360
diff changeset
18 * Added code to honor S$HUP signal and exit when received to support
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
19 * networking.
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
20
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
21 nam Shell
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
22 ttl Enhanced shell for NitrOS-9
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
23
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
24 * Disassembled 93/04/15 14:58:18 by Disasm v1.6 (C) 1988 by RML
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
25 * Signals: Signals 2 & 3 are assigned new keys to handle forward/backward
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
26 * command history. Signal $B (11) is the signal sent out on a key being ready
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
27 * for normal command processing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
28
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
29 ifp1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
30 use defsfile
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
31 endc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
32
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
33 tylg set Prgrm+Objct
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
34 atrv set ReEnt+rev
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
35 rev set $00
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
36 edition set 23
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
37
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
38 mod eom,name,tylg,atrv,start,size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
39
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
40 u0000 rmb 1 Path # for standard input
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
41 u0001 rmb 1 Path # for standard output
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
42 u0002 rmb 1 Path # for standard error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
43 u0003 rmb 1 # of 256 byte pages of data mem for frked module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
44 u0004 rmb 2 Temp ptr (current parse ptr, mem module ptr,etc)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
45 u0006 rmb 2 Size of current group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
46 u0008 rmb 2 Pointer to start of current group (past '(')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
47 u000A rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
48 u000C rmb 1 Current char. being processed in command parser
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
49 u000D rmb 1 # of command groups [ '()' groupings ]
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
50 u000E rmb 1 unprocessed signal # (0=none waiting)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
51 u000F rmb 1 ??? Flag of some sort
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
52 u0010 rmb 2 ??? (ptr to some module name)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
53 u0012 rmb 1 Current working DIR path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
54 u0013 rmb 1 Flag to kill parent process (1=Kill parent)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
55 u0014 rmb 1 Flag: If set, a result must not be 0 ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
56 u0015 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
57 u0016 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
58 u0017 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
59 u0018 rmb 1 Immortal shell (0=NO)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
60 * A clearing routine only does u0000 to u0018
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
61 u0019 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
62 u001A rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
63 u001C rmb 1 Shell logging on flag (0=OFF)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
64 u001D rmb 1 Shell prompting (0=ON)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
65 u001E rmb 1 Echo input (0=OFF)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
66 u001F rmb 1 Variable expansion (0=ON)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
67 u0020 rmb 1 Kill shell on error (0=OFF)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
68 u0021 rmb 1 Process # to set priority on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
69 u0022 rmb 1 Priority to set (0=don't change) (ours or fork)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
70 u0023 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
71 u0025 rmb 2 End of data mem ptr (top of stack)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
72 u0027 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
73 u0028 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
74 u0029 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
75 u002A rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
76 u002C rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
77 u002E rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
78 u002F rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
79 u0030 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
80 u0031 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
81 u0032 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
82 u0034 rmb 3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
83 u0037 rmb 1 Flag: 0=Data dir .PWD invalid, 1=valid
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
84 u0038 rmb 1 Flag: 0=Exec dir .PXD invalid, 1=valid
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
85 u0039 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
86 u003A rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
87 u003B rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
88 u003D rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
89 u003E rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
90 u0040 rmb 2 Ptr to start of filename (vs. pathname) ('/')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
91 * Shell prompt flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
92 u0042 rmb 1 Current working dir path already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
93 u0043 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
94 u0044 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
95 u0045 rmb 1 ??? <>0 means looking for GOTO label?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
96 u0046 rmb 1 Flag: 1=GOTO label found?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
97 u0047 rmb 1 Error code from ReadLn or signal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
98 u0048 rmb 2 Ptr to 1st char after redirection symbols
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
99 u004A rmb 2 Ptr to text message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
100 u004C rmb 2 Size of text message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
101 u004E rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
102 u004F rmb 1 0=no pathname in parm line, else IS pathname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
103 u0050 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
104 u0052 rmb 2 Current expanded buffer size (max=2048)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
105 u0054 rmb 2 Ptr to current char in wildcard filename we are
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
106 * checking
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
107 u0056 rmb 2 Ptr to current pos in expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
108 u0058 rmb 2 Pointer to end of GOTO label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
109 u005A rmb 2 User ID # from F$ID call
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
110 u005C rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
111 u005D rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
112 u005E rmb 1 Device type: 0=SCF (keyboard),1=RBF (Scriptfile)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
113 u005F rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
114 u0060 rmb 1 Data module linked flag: 1= Yes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
115 u0061 rmb 2 Ptr to data module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
116 u0063 rmb 2 Ptr to intercept routines data mem
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
117 u0065 rmb 2 Execution address of linked module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
118 u0067 rmb 2 Start address of module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
119 u0069 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
120 u006B rmb 1 Flag: 0=No module to unlink, <>0 module to unlink
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
121 u006C rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
122 u006D rmb 1 Start of device name buffer (start with '/')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
123 u006E rmb 71 Actual device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
124 u00B5 rmb 20 Start of another device name buffer ('/')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
125 u00C9 rmb 13
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
126 u00D6 rmb 13 Standard module header info (M$ID-M$Mem)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
127 u00E3 rmb 5 Module name string (reserves 64 chars)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
128 u00E8 rmb 3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
129 u00EB rmb 4
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
130 u00EF rmb 10 Temp buffer (many uses)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
131 u00F9 rmb 6
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
132 u00FF rmb 37 Place to point SP when CHAINing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
133 u0124 rmb 81 Temporary buffer (used for several things)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
134 u0175 rmb 119 Part of temp buffer for ReadLn (200 chars total)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
135 u01EC rmb 2 Least sig. 2 digits of process # (ASCII format)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
136 u01EE rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
137 u01EF rmb 2 Holding area for 2 digit ASCII conversions
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
138 * Shell prompt parsing flags
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
139 u01F1 rmb 1 Process ID # already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
140 u01F2 rmb 1 Standard output device name already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
141 u01F3 rmb 1 Quoting on flag in shell prompt string parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
142 u01F4 rmb 1 Date already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
143 u01F5 rmb 1 Time already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
144 u01F6 rmb 1 Date OR time already done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
145 u01F7 rmb 2 Size of expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
146 u01F9 rmb 25 Current shell prompt string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
147 u0212 rmb 1 Lead in Line feed for expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
148 u0213 rmb 199 Expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
149 u02DA rmb 6 Date/time packet
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
150 u02E0 rmb 8 Date string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
151 u02E8 rmb 1 Space separating date & time (for shell init)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
152 u02E9 rmb 9 Time string (and CR)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
153 u02F2 rmb 131
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
154 u0375 rmb 131
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
155 u03F8 rmb 29
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
156 u0415 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
157 u0417 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
158 u0418 rmb 400 Intercept routines memory area (not used)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
159 u05A8 rmb 810 Shell variables (user?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
160 u08D2 rmb 810 Shell variables (shell sub?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
161 u0BFC rmb 80
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
162 u0C4C rmb 81 Copy of GOTO label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
163 u0C9D rmb 32 DIR Entry buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
164 u0CBD rmb 32 Shell logging filename (append mode '+')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
165 u0CDD rmb 400 PATH=Buffer (each entry CR terminated)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
166 u0E6D rmb 2048 Fully expanded filenames buffer (for wildcards)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
167 * Actually,this next block appears to be generic buffers for various functions
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
168 u166D rmb 80 Process descriptor copies go here (512 bytes)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
169 u16BD rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
170 u16BE rmb 80
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
171 u170E rmb 238
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
172 u17FC rmb 10
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
173 u1806 rmb 2 ??? Ptr to end of shell history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
174 u1808 rmb 2 Ptr to where next history entry will go
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
175 u180A rmb 2 Ptr to start of shell history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
176 u180C rmb 1 # of lines in history buffer (1-(u180C))
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
177 u180D rmb 1 Current line # in history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
178 u180E rmb 1 Original keyboard terminate char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
179 u180F rmb 1 Original keyboard interrupt char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
180 u1810 rmb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
181 u1811 rmb 1 Original end of line NUL count
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
182 u1812 rmb 1 Flag to indicate if we have to restore PD.OPT
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
183 u1813 rmb 2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
184 u1815 rmb 808 Shell history copies start here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
185 u1B3D rmb 963 Local stack space, etc.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
186 size equ .
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
187 name equ *
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
188 L000D fcs /Shell/
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
189 fcb edition
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
190 L0013 fcb Prgrm+PCode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
191 fcs 'PascalS'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
192 fcb Sbrtn+CblCode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
193 fcs 'RunC'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
194 fcb Sbrtn+ICode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
195 L0021 fcs 'RunB'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
196 fcb $00,$00,$00,$00,$00,$00,$00,$00,$00
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
197 L002E fcb C$LF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
198 fcc 'Shell+ v2.2a '
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
199 L003C fcb $00
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
200 L003D fcc '{@|#}$: '
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
201 L0055 fcc '+++START+++'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
202 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
203 L0061 fcc '+++END+++'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
204 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
205 * Intercept routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
206 L006B stb <u000E Save signal code & return
2372
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2360
diff changeset
207 * +++ BGP added for Hang Up
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2360
diff changeset
208 * +++ Note we are exiting even if shell is immortal!
bfb8eefc19e1 Renamed S$Peer to S$HUP
boisy
parents: 2360
diff changeset
209 cmpb #S$HUP
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
210 lbeq exit
2360
36b1afb77372 fixed assemble error
boisy
parents: 2358
diff changeset
211 * +++
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
212 rti
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
213
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
214 start leas -5,s Make 5 byte buffer on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
215 pshs y,x,d Save Top/bottom of param area, and size of area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
216 leax >u1815,u Pointer to start of history buffer area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
217 stx >u1808,u Save ptr to where next history entry goes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
218 stx >u180A,u Save ptr to start of history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
219 leax >$0328,x Setup up another pointer (end of history area?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
220 stx >u1806,u Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
221 clr >u1812,u Clear flag that we have to restore PD.OPT
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
222 clr >u180D,u Current line # of history buffer=0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
223 clr >u180C,u # lines in history buffer=0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
224 ldx 2,s Get back top of data area ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
225 ldb #$FF 255 bytes to clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
226 lbsr L0412 Go clear direct page
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
227 sts <u0025 Save current stack ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
228 stu <u0027 Save Data mem ptr (0)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
229 leax >u0418,u Point to intercept routines memory area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
230 stx <u0063 Save a copy of it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
231 leax <L006B,pc Point to intercept routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
232 os9 F$Icpt Setup the intercept routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
233 lbsr L16A6 Get user #, and make 2 digit ASCII ver. @ 1EC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
234 lbsr L1674 Make shell logging pathname @ CBD
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
235 leax <L003D,pc Point to default shell prompt string
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
236 lbsr CmdPEq Go create shell prompt string & prompt itself
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
237 leax >u05A8,u Point to start of shell variables
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
238 ldd #C$CR*256+20 Carriage return (blank entries) & all 20 of them
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
239 L009C sta ,x Mark shell variable as blank
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
240 leax <81,x Point to next entry (81 bytes/entry)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
241 decb Do until all 20 are done (user & shell sub)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
242 bne L009C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
243 sta >u0CDD,u Init 1st 2 entries of PATH= buffer to CR's
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
244 sta >u0CDD+1,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
245 puls x,d Get parameter ptr & parameter size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
246 std <u0006 Save size of parameter area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
247 beq L00BF If no parameters, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
248 lbsr L041B Pre-Parse parameters passed to this shell
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
249 lbcs L01FA Error, go handle it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
250 tst <u000C Any char being processed in parser?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
251 lbne L01F9 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
252 L00BF lbsr L0225 Release any keyboard/mouse signals & get PD.OPT
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
253 inc <u006C ??? Set flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
254 lds ,s++ Since parameters parsed, point SP to top of mem
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
255 sts <u0025 Save end of data mem ptr (top of stack)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
256 stu <u0027 Save start of data mem ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
257 L00CC leax >L002E,pc Point to Shellplus v2.2 message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
258 tst <u001D Shell prompting turned on?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
259 bne L00EA No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
260 ldy #$000E Length of message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
261 lda #$01 Standard out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
262 os9 I$Write Write it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
263 lbcs L0200 If error writing, terminate Shellplus
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
264 bsr L00FB Go create date & time strings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
265 lbsr L021B Write out date & time
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
266 lbcs L0200 If error writing, terminate Shellplus
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
267 L00EA clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
268 sta <u005C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
269 leax >L0055,pc Point to '+++START+++' for shell logging
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
270 lbsr L07E7 Go deal with logging if necessary
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
271 tst <u001D Shell prompting turn on?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
272 bne L0120 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
273 bra L010D Yes, do something else first
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
274
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
275 L00FB clr >u01F6,u Clear date or time done flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
276 lbsr L0B3B Create current date & time strings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
277 lda #C$SPAC Put in a space to separate date & time
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
278 sta >u02E8,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
279 leax >u02E0,u Point to start of date buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
280 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
281
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
282 * Shell just booted goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
283 L010D lbsr L09F7 Update expanded shell prompt if needed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
284 leax >u0212,u Point to expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
285 ldy >u01F7,u Get size of expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
286 L0119 tst <u001D Shell prompting on?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
287 bne L0120 No, continue on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
288 lbsr L021F Print shell prompt to standard error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
289 * Shell already booted goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
290 L0120 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
291 leax >u0124,u Point to an input line of some sort
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
292 tst <u006B Any module linked?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
293 beq L015B No, continue on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
294 ldy <u0065 Yes, get Execution address of linked module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
295 cmpy <u0069 ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
296 lbhs L01F0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
297 ldb #200 LDW #200/PSHS X/TFM Y+,X+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
298 pshs x Copy temporary buffer to [<u0065]
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
299 L0137 lda ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
300 sta ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
301 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
302 beq L014E Whole buffer copied, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
303 cmpy <u0069 But don't go past here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
304 bhs L0147
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
305 cmpa #C$CR Also, stop on carriage return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
306 bne L0137
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
307 L0147 sty <u0065 Save new start address
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
308 puls x Restore ptr to u0124
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
309 bra L01B9 Skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
310
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
311 L014E lda ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
312 cmpy <u0069
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
313 bhs L0147
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
314 cmpa #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
315 bne L014E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
316 bra L0147
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
317
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
318 L015B tst <u005E We reading from script file?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
319 bne L017F Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
320 ldd #SS.Relea Std input path/release keyboard+mouse signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
321 os9 I$SetStt Release any keyboard signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
322 lbsr L18DB Go modify signals 2&3 to use up/down arrows,
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
323 * set up to re-enable Kybd signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
324 L016A clr <u000E Clear out last signal received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
325 os9 I$SetStt Re-set up SS.SSig
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
326 * NOTE: This BRA L0177 is required for type-ahead to work
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
327 bra L0177 Go check for history-related signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
328
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
329 * DOESN'T SEEM TO GET BACK TO HERE WHEN ABORT BUG APPEARS
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
330 L0171 ldx #$0000 Sleep until signal is received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
331 os9 F$Sleep
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
332 L0177 lbra L191C Go check for history signals (PD.QUT & PD.INT)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
333 * Signal received is not PD.QUT or PD.INT goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
334 L017B cmpb #$0B Key pressed signal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
335 bne L0171 No, ignore signal & go to sleep again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
336 * Keyboard input received signal goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
337 L017F leax >u0124,u Point to temp buffer to hold line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
338 clra Std Input
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
339 ldy #200 Maximum 200 char. input
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
340 lbra L193E Go read the rest of line as ReadLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
341
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
342 * Comes here after line or signal received & processed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
343 * NOTE: IF LINE RECEIVED, PD.QUT & PD.INT ARE BACK TO NORMAL VALUES
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
344 L018B bcc L01B9 If no errors, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
345 cmpb #E$EOF <ESC> key in ReadLn?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
346 beq L01F0 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
347
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
348 L0191 lds <u0025 Get top of stack ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
349 ldu <u0027 Get back ptr to DP
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
350 stb <u0047 Save error code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
351 tst <u0046 GOTO label active?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
352 bne L01A4 Yes, go print error message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
353 tst <u0018 Is this shell immortal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
354 bne L01A4 Yes, go print error message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
355 tst <u0020 Kill shell on error?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
356 bne L01FA Yes, go do that
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
357
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
358 L01A4 os9 F$PErr Print the error message
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
359 tst <u0046 GOTO label active?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
360 lbeq L010D No, go print shell prompt/process next line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
361 clr <u0046 Clear GOTO label flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
362 leax >u0C4C,u Point to copy of GOTO label name
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
363 lbsr CmdGOTO Go process GOTO line
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
364 lbra L010D Go print shell prompt/process next line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
365
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
366 * No error received on line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
367 L01B9 cmpy #$0001 Just 1 char read (just a CR)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
368 bhi L01CE No, go parse parameters
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
369 lbsr L09F7 Go update date/time & expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
370 leax >u0213,u Point to expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
371 ldy >u01F7,u Get size of expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
372 lbra L0119 Go print shell prompt & get next line from user
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
373
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
374 * No errors-got input line, and there is something in it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
375 L01CE lbsr L041B Go parse parameters?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
376 pshs cc Save flags
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
377 tst <u0045
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
378 bne L01D9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
379 clr <u0047 Clear error/signal code from ReadLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
380 L01D9 puls cc Restore flags
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
381 lbcc L010D If no error from parse, do prompts & read again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
382 tstb If a 0 error, do prompts & read again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
383 lbeq L010D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
384 tst <u0045 ??? Do we care about errors?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
385 bne L0191 No, go handle error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
386 stb <u0047 Save error/signal code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
387 bra L0191 Go handle error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
388
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
389 L01EC fcc 'eof'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
390 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
391
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
392 * <ESC> received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
393 L01F0 tst <u001D Shell prompting on?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
394 L01F2 bne L01F9 No, skip printing 'eof' to screen
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
395 leax <L01EC,pc Point to 'eof' string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
396 bsr L021B Write it out to std error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
397 L01F9 clrb No error flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
398 * Possible shell error - Process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
399 L01FA lda <u0018 Is this shell immortal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
400 lbne L0BDA Yes, go close or dupe paths
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
401 * Shell not immortal, exit routine in here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
402 L0200 pshs u,b,cc Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
403 tst <u006B Shellsub module to unlink?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
404 beq L020B No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
405 ldu <u0067 Yes, get ptr to module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
406 os9 F$UnLink Unlink it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
407 L020B puls u,b,cc Restore U, error # & flags
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
408 * EX with no module name (or non-existant one) go here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
409 L020D pshs b,cc Save error # & flags
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
410 leax >L0061,pc Point to '+++END+++' string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
411 lbsr L07E7 Close log file if one is open, restore ID #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
412 puls b,cc Restore error # & flags
2358
79c544b33a09 Made to honor S$Peer signal (sent when peer disconnects)
boisy
parents: 1505
diff changeset
413 exit os9 F$Exit Terminate shellplus
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
414
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
415 L021B ldy #80 Write up to 80 chars or CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
416 L021F lda #$02 Std error path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
417 os9 I$WritLn Write message out & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
418 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
419
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
420 L0225 pshs y,x,d Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
421 ldd #SS.Relea Std In & Release keyboard & mouse signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
422 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
423 bcc L0233 No error, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
424 lda #$01 Couldn't release keyboard/mouse signals flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
425 bra L0241
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
426
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
427 L0233 leax >u0124,u Point to buffer for current path options
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
428 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
429 clrb CHANGE TO CLRB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
430 os9 I$GetStt Get std input path options
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
431 lda >u0124,u Get Device type (0 (SCF) usually)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
432
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
433 L0241 sta <u005E Save device type (1=SS.Relea failed)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
434 puls pc,y,x,d Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
435
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
436 * R= command (redirect specific paths)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
437 CmdREq lda ,x Get char from input line
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
438 cmpa #'< Is it input path?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
439 beq L0251 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
440 cmpa #'> Is it an output/error path?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
441 lbne L0BCF No, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
442 L0251 pshs x Preserve ptr to 1st redirection symbol
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
443 leay >L03CF,pc Point to modifier symbol table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
444 lbsr L092A Go to command line parser
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
445 lbcs L0BCF Error, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
446 ldd ,y Get table offset
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
447 jsr d,y Call appropriate subroutine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
448 stx <u0048 Save ptr to source after redirection symbols
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
449 puls x Restore ptr to redirection symbols
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
450 lbcs L0B96 If error in subroutine, close paths & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
451
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
452 L026A lda ,x+ Get 1st char again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
453 cmpa #'< Input path?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
454 beq L026A Yes, skip to next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
455 cmpa #'> Output or Error path?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
456 beq L026A Yes, skip to next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
457 cmpa #'- Overwrite old file?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
458 beq L026A Yes, skip to next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
459 cmpa #'+ Append to old file?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
460 beq L026A Yes, skip to next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
461 leax -1,x Point to non-redirect char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
462 bsr L02A3 Make name buffer, release signals,parse modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
463 clrb Start path # 0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
464 L0281 pshs b Save on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
465 lda b,u Get special path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
466 beq L028A None, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
467 os9 I$Close Close the path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
468 L028A puls b Get path # back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
469 clr b,u Clear out entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
470 incb Next path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
471 cmpb #$03 Done the 3 standard paths yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
472 blo L0281 No, keep doing until all done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
473 ldx <u0048 Get ptr to redirected dev/file name & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
474 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
475 * Z= command (immortal shell setting, but kill parent process)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
476 CmdZEq inc <u0013 Flag we want to kill parent
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
477 * I= command (immortal shell setting)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
478 CmdIEq lbsr L0CD2
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
479 lbcs L0B96
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
480 bsr L02A3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
481 bra L02D4
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
482
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
483 * Create device name buffer @ u006D, Write NUL to std out, parse special
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
484 * chars: # @ @+hibit $ ( ), Release any keyboard/mouse signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
485 L02A3 pshs x Prsrve ptr to file/dev name we're redirecting to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
486 ldb #SS.DevNm Get device name call code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
487 leax <u006D,u Point to buffer for path names
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
488 lda #'/ Preload '/' for device names
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
489 sta ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
490 clra Standard input path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
491 os9 I$GetStt Get the current device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
492 puls x Get back ptr to file/dev name for redirection
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
493 lbcs L0B96 Error on GetStt, shut down paths & exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
494 ldy #$0001 One char to write
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
495 pshs x Prsrve ptr to file/dev name we're redirecting to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
496 leax >L003C,pc Point to a NUL
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
497 lda #1 Std out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
498 os9 I$Write Write the NUL out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
499 puls x Restore Devname ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
500 lbcs L0B96 Error on Write, shut down paths & exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
501 lbsr L0A04 Do normal parsing - includes #,@,$e0,$,(,)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
502 lbsr L0225 Release signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
503 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
504
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
505 L02D4 inc <u0018 Set 'immortal shell' flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
506 inc <u0019 ??? (flag used by L0B96 routine)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
507 lbsr L0B96
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
508 clr <u0019
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
509 tst <u0013 Do we want to kill the parent process?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
510 beq L02FC
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
511 IFEQ Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
512 ldx <D.Proc
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
513 ELSE
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
514 os9 F$ID Get our process ID # into A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
515 pshs x Preserve X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
516 leax >u166D,u Point to process descriptor buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
517 os9 F$GPrDsc Get our process descriptor
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
518 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
519 lda P$PID,x Get our parents process #
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
520 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
521 puls x Restore X
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
522 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
523 beq L02A3 If parent's process # is 0 (system), skip back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
524 clrb S$Kill signal code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
525 os9 F$Send Send it to parent
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
526 lbcs L0191 If error sending signal, go to error routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
527 L02FC clrb No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
528 stb <u0013 Clear 'kill parent' flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
529 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
530
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
531 * Command list
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
532 CmdList fdb L0B87-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
533 fcs '*'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
534 fdb CmdW-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
535 fcs 'W'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
536 fdb CmdCHD-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
537 fcs 'CHD'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
538 fdb CmdCHX-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
539 fcs 'CHX'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
540 fdb CmdCLS-*
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
541 fcs 'CLS'
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
542 fdb CmdCHD-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
543 fcs 'CD'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
544 fdb CmdCHX-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
545 fcs 'CX'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
546 fdb CmdEX-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
547 fcs 'EX'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
548 fdb CmdKill-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
549 fcs 'KILL'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
550 fdb CmdX-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
551 fcs 'X'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
552 fdb CmdNX-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
553 fcs '-X'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
554 fdb CmdPEq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
555 fcs 'P='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
556 fdb CmdP-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
557 fcs 'P'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
558 fdb CmdNP-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
559 fcs '-P'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
560 fdb CmdT-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
561 fcs 'T'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
562 fdb CmdNT-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
563 fcs '-T'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
564 fdb CmdSETPR-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
565 fcs 'SETPR'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
566 fdb CmdIEq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
567 fcs 'I='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
568 fdb CmdREq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
569 fcs 'R='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
570 fdb CmdZEq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
571 fcs 'Z='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
572 fdb CmdSEMI-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
573 fcs ';'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
574 fdb CmdPWD-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
575 fcs '.PWD'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
576 fdb CmdPXD-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
577 fcs '.PXD'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
578 fdb CmdMEq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
579 fcs 'M='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
580 fdb CmdVAR-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
581 fcs 'VAR.'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
582 fdb CmdV-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
583 fcs 'V'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
584 fdb CmdNV-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
585 fcs '-V'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
586 fdb CmdPATHEq-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
587 fcs 'PATH='
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
588 fdb CmdPAUSE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
589 fcs 'PAUSE'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
590 fdb CmdINC-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
591 fcs 'INC.'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
592 fdb CmdDEC-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
593 fcs 'DEC.'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
594 fdb CmdIF-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
595 fcs 'IF'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
596 fdb CmdTHEN-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
597 fcs 'THEN'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
598 fdb CmdELSE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
599 fcs 'ELSE'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
600 fdb CmdTHEN-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
601 fcs 'FI'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
602 fdb CmdTHEN-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
603 fcs 'ENDIF'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
604 fdb CmdCLRIF-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
605 fcs 'CLRIF'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
606 fdb CmdGOTO-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
607 L03AC fcs 'GOTO'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
608 fdb CmdONERR-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
609 fcs 'ONERR'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
610 fdb CmdL-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
611 fcs 'L'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
612 fdb CmdNL-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
613 fcs '-L'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
614 fdb CmdSTARTUP-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
615 fcs 'S.T.A.R.T.U.P'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
616 fdb $0000
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
617 L03CF fdb CmdPIPE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
618 fcs '!'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
619 fdb CmdPIPE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
620 fcs '|'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
621 fdb CmdSEMIC-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
622 fcs ';'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
623 fdb CmdAmp-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
624 fcs '&'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
625 fdb CmdCR-*
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
626 fcb $80+C$CR
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
627 L03DE fdb CmdIOE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
628 fcs '<>>>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
629 fdb CmdIE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
630 fcs '<>>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
631 fdb CmdIO-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
632 fcs '<>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
633 fdb CmdOE-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
634 fcs '>>>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
635 fdb CmdErr-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
636 fcs '>>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
637 fdb CmdIn-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
638 fcs '<'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
639 fdb CmdOut-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
640 fcs '>'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
641 fdb CmdMem-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
642 fcs '#'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
643 fdb CmdCaret-*
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
644 fcs '^'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
645 fdb $0000 End of table marker
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
646
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
647 L0404 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
648 fcc '()'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
649 fcb $ff
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
650 L0408 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
651 fcc '!#&;<>^|'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
652 fcb $ff
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
653
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
654 * Subroutine: Clears B bytes of memory to NUL's starting @ U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
655 L0412 pshs u Clear memory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
656 L0414 clr ,u+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
657 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
658 L0417 bne L0414
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
659 L0419 puls pc,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
660
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
661 * Pre-Parse parameters passed to this shell. Will copy from parm area to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
662 * buffer area at u0166D, checking for raw mode access allowability if needed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
663 * Will also
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
664 * Entry: X=ptr to parm area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
665 L041B ldb #$18 # of bytes to clear in DP
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
666 L041D bsr L0412 Go clear from <u0000 to <u0018 (immortal off)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
667 tst <u006C ??? (If shell is initing, it's 0)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
668 lbeq L04CE Shell just initializing, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
669 leay >u17FC,u Point to end of buffer marker
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
670 pshs y Save ptr on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
671 leay >u166D,u Point to buffer for process descriptor
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
672 L042F bsr L0486 Copy next char (check for '@', possibly eat)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
673 cmpa #C$CR CR?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
674 beq L04A8 Yes, force CR into ,y & process line from start
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
675 cmpy ,s At end of buffer?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
676 beq L04A8 Yes, force CR, process line from start
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
677 tst <u001F Variable expansion on?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
678 bne L042F No, check next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
679 cmpa #'% Is it a '%' (shell variable)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
680 bne L042F No, do next character
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
681 leay -1,y Back up destination ptr to where '%' is
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
682 pshs x Save current position in parms
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
683 lda ,x Get 1st char of shell variable nam
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
684 cmpa #'* Shell variable for last error code received?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
685 beq L049D Yes,replace shell var with contents of shell var
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
686 leax >u05A8,u Point to user shell variable contents table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
687 cmpa #'% 2nd '%'= shellsub variable
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
688 bne L0460 No, just user, go process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
689 puls x Get back parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
690 leax 1,x Skip over 2nd '%'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
691 lda ,x Get shellsub variable #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
692 pshs x Save parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
693 leax >u08D2,u Point to shellsub variable contents table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
694 * Entry: A=ASCII 0-9 for either shell or shellsub variable #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
695 L0460 cmpa #'9 ASCII numeric?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
696 bhi L0470 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
697 cmpa #'0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
698 blo L0470
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
699 suba #$30 Yes, bump down to binary equivalent
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
700 ldb #81 Point to proper variable entry within var table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
701 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
702 leax d,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
703 incb ??? Used in TSTB below
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
704 L0470 bsr L0486 Copy char from var table to pre-parse buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
705 cmpy 2,s Hit end of pre-parse buffer?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
706 beq L04A6 Yes, force CR at end of it, do full parse
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
707 cmpa #C$CR End of variable?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
708 bne L0470 No, keep copying characters
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
709 leay -1,y Knock ptr back one (to where CR is)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
710 puls x Get current parm ptr back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
711 tstb ??? flag to skip a byte in parm or not
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
712 beq L042F Don't skip
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
713 L0482 leax 1,x Skip to next byte in parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
714 bra L042F Continue pre-parse
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
715
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
716 * Copy char from parm area to command line buffer - if '@', eat if user is
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
717 * not super-user (#0)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
718 * Entry: X=ptr to current pos. in original parm buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
719 * Y=ptr to current pos. in new, pre-parsed buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
720 L0486 lda ,x+ Get char from parms
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
721 cmpa #'@ Raw mode request?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
722 bne L049A Skip ahead if not (SHOULD BE BNE)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
723 L048C pshs y,a Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
724 os9 F$ID Get user ID #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
725 cmpy #$0000 Is it 0 (superuser)? (should be leay ,y)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
726 puls y,a Restore regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
727 beq L049A Yes, allow char thru
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
728 rts Otherwise eat it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
729
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
730 L049A sta ,y+ Save char & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
731 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
732
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
733 * Shell variable '%* (for last error code) requested
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
734 * Put contents of shell var. into pre-parsed command line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
735 L049D puls x Get back parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
736 lbsr L168A Put error code into preparse buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
737 leay 3,y Skip over error code space we just added
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
738 bra L0482 Skip over shell varname, continue preparse
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
739
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
740 L04A6 leas 2,s Eat stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
741 L04A8 lda #C$CR Force CR as last char in buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
742 sta ,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
743 puls y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
744 leax >u166D,u Point to start of pre-parse buffer again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
745 L04B2 bra L04CE Start real parse
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
746
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
747 L04B4 fcb C$LF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
748 fcc 'Expanded line too long'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
749 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
750 L04CC fcc '.'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
751 L04CD fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
752
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
753 * Parse command line buffer - already pre-parsed (user 0 RAW mode checks &
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
754 * shell/shellsub variable expansion is already done)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
755 * Entry: X=Ptr to pre-parsed command line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
756 L04CE lda ,x Get 1st char from parameter area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
757 cmpa #'* Is it a comment?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
758 beq L04DE Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
759 cmpa #': Is it a wildcard on/off?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
760 bne L04DA No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
761 leax 1,x Bump ptr past it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
762 L04DA cmpa #': Is it a wildcard off?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
763 * FOLLOWING LINE: BEQ means wildcarding default off, BNE = on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
764 beq L04F0 No, go process wildcarding
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
765 * No wildcard processing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
766 L04DE leay >u0E6D,u Point Y to expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
767 lbsr L1320 Copy param area to buffer area until 1st CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
768 leax >u0E6D,u Point X to expanded (wildcard) buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
769 ldy #$0800 Max. size of expanded buffer (2048 bytes)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
770 lbra L079B Process line without wildcards
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
771
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
772 * Wild carding processor
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
773 * Entry: X=ptr to current position in pre-parsed parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
774 * 1st, set up error msg for if buffer gets full
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
775 L04F0 leay >L04B4,pc Point to 'Expanded line too long'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
776 sty <u004A Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
777 ldy #$0018 Get size of text
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
778 sty <u004C Save it too
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
779 leay >L04CD,pc Point to CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
780 sty <u0048 Save ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
781 sts <u0050 Save stack ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
782 leay >u0E6D,u Point to fully expanded buffer (2k max)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
783 sty <u0056 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
784 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
785 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
786 sta <u0012 No current working DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
787 sta <u004F Flag no pathname in parm area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
788 std <u0052 Expanded buffer size=0 bytes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
789 bra L0520 Enter main loop for wildcards
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
790
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
791 L051D lbsr L06FB Special shell chars handling
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
792 L0520 lbsr L0746 Check for special chars (wildcard or shell)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
793 bcc L051D Special shell char process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
794 * Wildcard char found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
795 pshs x Save current pre-parsed parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
796 bsr L0549 Check from that point for '/' or special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
797 ldx ,s Get previous parm ptr back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
798 bcc L0557 No '/' found, open current dir '.'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
799 * Found '/' (part of path) - keep looking for last '/' for filename (not
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
800 * pathname) portion
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
801 L052D bsr L0549 Check for special char or '/' again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
802 bcc L0535 No '/', skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
803 stx <u0040 Save latest ptr to '/' in parm line found so far
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
804 bra L052D See if any more sub-paths
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
805
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
806 * Found one or more '/' path dividers in current parm line.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
807 * Entry: <u0040 - contains the last '/' found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
808 L0535 inc <u004F Flag that their IS a pathname from parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
809 L0538 ldx <u0040 Get last level of path ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
810 puls y Get original parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
811 sty <u0040 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
812 pshs x Save filename ptr on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
813 lda #C$SPAC Save space over '/' after pathname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
814 sta -1,x (before filename)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
815 tfr y,x Move original parm ptr to X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
816 bra L055E Open dir path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
817
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
818 * Parse from current position in pre-parsed parm line until shell special
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
819 * char, or '/' found (path)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
820 * Entry: X=ptr to current pos in pre-parsed parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
821 * Exit: Carry clear if special shell char found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
822 * Carry set if '/' found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
823 * X=ptr to found char+1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
824 L0549 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
825 lda ,x+ Get next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
826 lbsr L05D3 See if shell special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
827 beq L0556 Yes, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
828 cmpa #'/ No, is it a slash (path start)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
829 bne L0549 No, Keep checking for / or special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
830 comb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
831 L0556 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
832
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
833 * No '/' found in parm line at all
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
834 L0557 clr <u004F Flag no pathname from parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
835 leax >L04CC,pc Point to '.'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
836 * Entry: X=ptr to pathname to directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
837 * 0-1,s = Ptr to filename spec we are looking for in this directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
838 L055E lda #DIR.+READ. Open directory in READ mode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
839 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
840 lbcs L0776 Error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
841 sta <u0012 Save current DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
842 puls x Get back ptr to filename (not pathname)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
843 lbsr L0746 Check for special shell char or wildcard
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
844 lbcc L06E3 Special shell char found, ??????
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
845 L0572 lda ,x+ Get next char from filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
846 cmpa #C$CR End of user specified filename (CR)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
847 lbeq L0789 Yes, close DIR and proceed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
848 cmpa #', Comma?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
849 beq L0572 Yes, skip it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
850 cmpa #C$SPAC Space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
851 beq L0572 Yes, skip it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
852 leax -1,x Other char, point to it.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
853 stx <u0054 Save ptr to it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
854 lda <u0012 Get DIR path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
855 pshs u Preserve u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
856 ldx #$0000 Skip '.' and '..' dir entries
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
857 ldu #$0040
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
858 os9 I$Seek
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
859 lbcs L0776 Error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
860 puls u Restore u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
861 L0599 leax >u0C9D,u Point to dir entry buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
862 pshs x Save ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
863 lda <u0012 Get Current dir path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
864 ldy #$0020 Read 1 file entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
865 os9 I$Read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
866 lbcs L06BD Error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
867 puls y Restore pointer to dir filename buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
868 lda ,y Get 1st char of entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
869 tsta Is it a deleted file?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
870 beq L0599 Yes, skip it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
871 ldx <u0054 Get ptr to current char in expanded filename bfr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
872 bsr L05EF Check wildcard spec against this filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
873 bcs L0599 No match, skip to next file in DIR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
874 tst <u004F Was a pathname specified?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
875 beq L05CA No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
876 ldx <u0040 Yes,get ptr to end of pathname/start of filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
877 lbsr L06FB Check for wildcard stuff there
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
878 ldx <u0056 Get current pos in expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
879 lda #'/ Save '/' there (to separate path & filename)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
880 sta -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
881 L05CA leax >u0C9D,u Point to start of matched DIR entry filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
882 lbsr L06FB Copy filename over, handling quoted chars, etc.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
883 bra L0599 On to next DIR entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
884
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
885 * Check if shell 'special' char. (except wildcards & shell var)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
886 * non-wildcard char in current byte of pre-parsed parm buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
887 * Entry: X=ptr to next char in parms buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
888 * A=current char in parms buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
889 * Exit: BEQ if shell special char found, BNE if just regular char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
890 * A=char we were checking
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
891 L05D3 pshs x Save parms buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
892 cmpa #'( Group start char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
893 beq L05ED Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
894 cmpa #') Group end char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
895 beq L05ED Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
896 cmpa #C$SPAC Space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
897 beq L05ED Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
898 cmpa #', Comma?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
899 beq L05ED Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
900 leax >L0408,pc Table of other special chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
901 L05E9 cmpa ,x+ Found match or end of table?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
902 bhi L05E9 No, keep checking (or fall through if not found)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
903 L05ED puls pc,x Exit with BEQ/BNE flag set
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
904
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
905 * IF wildcards were detected in preparsing, filename compares happen here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
906 * Entry: X=ptr to current char in user's pre-parse parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
907 * Y=ptr to start of current DIR entry filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
908 * Exit: Carry set if no match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
909 * Carry clear if match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
910 L05EF ldd ,x+ Get 2 chars (NOTE: PTR UP BY ONLY 1!)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
911 L05F1 cmpa #'* 1st char a * (multi-char wildcard)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
912 beq L064C Yes, go handle it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
913 cmpa #'? Question mark (single char wildcard)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
914 beq L0638 Yes, go handle it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
915 cmpa #'[ Start of ranged wildcard?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
916 lbeq L068B Yes, go handle it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
917 bsr L05D3 Not wildcard, check for special shell chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
918 beq L062B It is a special shell char, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
919 bsr L0631 Just regular char, force uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
920 pshs a Save char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
921 bsr L062D Force uppercase on DIR filename char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
922 eora ,s+ Same char as last parm char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
923 bne L062B No, exit with carry set
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
924 L060D lda ,y+ Re-get char from DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
925 bpl L05EF Not on last char yet, check next char from parm
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
926 ldd ,x At end of DIR filename, grab 2 chars from parm
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
927 bsr L05D3 Check 1st char against special shell chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
928 beq L0621 Found one, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
929 cmpa #'* Multi-char wildcard char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
930 bne L062B No, no match, exit with carry set
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
931 tfr b,a 1st char from parm is '*', check 2nd char for
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
932 bsr L05D3 special shell chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
933 bne L062B None found, no match, exit with carry set
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
934 L0621 lda -1,y Special char, get last char from DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
935 L0623 anda #$7F Strip 'end of filename' bit flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
936 ldb #C$SPAC Space char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
937 std -1,y Save 'fixed' last char & space
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
938 clrb Flag match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
939 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
940
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
941 L062B comb Flag no match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
942 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
943
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
944 * Force char to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
945 L062D lda ,y Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
946 anda #$7F Strip hi-bit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
947 L0631 cmpa #'A Need to force uppercase?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
948 blo L0637 No, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
949 anda #$DF Yes, force to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
950 L0637 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
951
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
952 * '?' single char wildcard found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
953 L0638 cmpb #'* Is next char a multi-char wildcard?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
954 beq L060D Yes, process as if just '*'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
955 cmpb #', 2nd char '-' or greater?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
956 bhi L060D Yes, process normally
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
957 lda ,y+ Get next char from DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
958 bpl L062B Not end of filename, Flag no match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
959 bra L0623 Save hibit stripped char & space, flag match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
960
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
961 L0646 lda ,y+ Get next char from DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
962 bpl L0646 Hunt for end of DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
963 bra L0623 Found it, fix hibit and add space to DIR entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
964
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
965 * '*' multi-char wildcard found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
966 L064C lda ,x+ Get next char after '*' from parm buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
967 bsr L05D3 Check for shell special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
968 beq L0646 Found one, check if end of DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
969 cmpa #'? Single char wildcard next?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
970 beq L067F Yes, Process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
971 cmpa #'[ Start of Ranged wildcard next?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
972 beq L067F Yes, process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
973 bsr L0631 Force char to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
974 pshs a Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
975 L065E bsr L062D Get next char from DIR filename, force uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
976 eora ,s+ Same char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
977 beq L066E Yes, possible resync after '*'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
978 L0664 leas -1,s Make room on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
979 lda ,y+ Re-get un-modified char from DIR filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
980 bpl L065E Not end of filename, try next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
981 leas 1,s Found end of filename, eat temp stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
982 bra L062B Flag no match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
983 * Above loop @ L0664/L065E uses sneaky stack stuff
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
984
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
985 * Found possible resync char match after '*'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
986 L066E leas -1,s Make room on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
987 pshs y,x Preserve both DIR & parm ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
988 bsr L060D Attempt normal matching using this resync
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
989 puls y,x Restore ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
990 leas 1,s Eat temp stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
991 bcs L0664 No, resync did not work, look for next resync
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
992 rts worked, exit with carry clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
993
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
994 L067B lda ,y+ Get next char in DIR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
995 bmi L062B Last char, flag no match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
996 * '?' found after '*' in parm buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
997 L067F pshs y,x Preserve both DIR and parm buffer ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
998 ldd -1,x Get previous & current parm chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
999 lbsr L05F1 Do normal sub-parsing from here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1000 puls y,x Restore ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1001 bcs L067B No match, go to next char in DIR and attemp resync
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1002 rts Matched, exit with match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1003
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1004 * Ranged wildcard here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1005 * Entry: X=ptr to 1st char in parm buffer AFTER '['
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1006 L068B ldd ,x+ Get 1st 2 chars of range sub-string from parm bfr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1007 bsr L0631 Force uppercase on 1st char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1008 exg b,a Force uppercase on 2nd char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1009 bsr L0631
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1010 exg b,a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1011 cmpa #'] Is 1st char a close range check char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1012 beq L062B Yes, flag no match for '[]'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1013 cmpa #'- Range separator char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1014 beq L06A7 Yes, need to get end of range
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1015 * Special case for [x] - acts as if just normal char (no range or wildcard)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1016 sta <u00EF No, save start of range char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1017 bsr L062D Get char from DIR filename, force uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1018 eora <u00EF Match only range char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1019 beq L06B4 Yes, skip to next char now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1020 * Special case for [xyz] - one of these chars must match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1021 bra L068B No, see if more single chars to try matching
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1022
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1023 * Actual range - need to get end of range char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1024 * Entry: B=high char of range
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1025 * <u00EF - current char (within range) we are checking against
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1026 L06A7 inc <u00EF Bump up start char's ascii value
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1027 cmpb <u00EF Hit end of range yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1028 beq L068B Yes, try next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1029 lbsr L062D Force char in A to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1030 eora <u00EF equal to current range check char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1031 bne L06A7 No, try next char in range
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1032 L06B4 ldd ,x+ Get next 2 chars from pathname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1033 cmpa #'] End of range?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1034 bne L06B4 No, check next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1035 lbra L060D End of range specifier, process normally
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1036
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1037 * Error reading from current DIR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1038 L06BD cmpb #E$EOF End of file error?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1039 lbne L0776 No, fatal error, leave
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1040 ldx <u0054 Get ptr to current char in wildcard filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1041 lda -1,x Get last char processed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1042 bsr L0714 Add it to new expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1043 L06C9 lda ,x+ Get next char, inc ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1044 stx <u0054 Save updated pointer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1045 cmpa #C$CR CR?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1046 lbeq L0789 Yes, append CR to expanded buffer, we are done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1047 lbsr L05D3 See if special shell char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1048 bne L06C9 Just regular char, go to next one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1049 pshs x Save current ptr to wildcard filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1050 ldx <u0056 Get current ptr in expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1051 sta -1,x Save that char overtop last char written
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1052 puls x Get wildcard ptr back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1053 bra L06EA Close dir path, go back into loop
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1054
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1055 * If special shell char found right after OPEN of DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1056 * Entry: X=ptr to filename (not pathname) - but with special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1057 L06E3 bsr L06FB Process special shell char copying
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1058 bsr L072F Close DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1059 lbra L051D More processing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1060
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1061 L06EA bsr L072F Close DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1062 lbra L0520 Go back to main wildcard processing loop
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1063
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1064 * This chunk (6EF-6F9) is for copying '\x' when x is NOT a wildcard char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1065 L06EF lda ,x+ Get quoted char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1066 bsr L0739 Check if it is [, * or ?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1067 beq L06F9 Yes, add that char to expanded buffer by itself
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1068 leax -2,x No, bump ptr back to '\'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1069 lda ,x+ Get '\' char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1070 L06F9 bsr L0714 Append that to output buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1071 * Special shell chars found goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1072 * This part copies filename from [,x] to expanded buffer, handling quoted
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1073 * wildcard chars, and ending on CR or special shell char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1074 L06FB lda ,x+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1075 cmpa #'\ Backslash (for quoted char)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1076 beq L06EF Yes, go get quoted char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1077 cmpa #C$CR Is it the end of the filename?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1078 beq L0789 Yes, append CR to expanded line, we are done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1079 bsr L073D Is it '?' or '*'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1080 beq L0714 Yes, add that char to expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1081 lbsr L05D3 Check if shell special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1082 beq L0714 Yes, add to expanded buffer, return from there
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1083 bsr L0714 No, add to expanded buffer, stay in this loop
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1084 bra L06FB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1085
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1086 * Add char to expanded line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1087 * Entry: A=char to append to expanded line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1088 * <u0056=Current position in expanded line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1089 * <u0052=Current size of expanded line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1090 * Exit: <u0056 & <u0052 updated
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1091 L0714 pshs x,a Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1092 ldx <u0056 Get current pos in expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1093 sta ,x+ Save char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1094 stx <u0056 Save updated expanded buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1095 ldd <u0052 Get expanded buffer size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1096 addd #$0001 Increase by 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1097 cmpd #2048 Is it full yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1098 bhi L0773 Yes, exit with expanded line too long error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1099 std <u0052 No, save new size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1100 puls pc,x,a Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1101
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1102 * Close DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1103 L072F lda <u0012 Get DIR path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1104 beq L0738 If none, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1105 os9 I$Close Close the path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1106 clr <u0012 Clear DIR path # to none
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1107 L0738 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1108
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1109 * Wildcard checks
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1110 * Entry: A=char to check
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1111 * Exit: BEQ if any of the 3 wildcard chars, or BNE if not
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1112 L0739 cmpa #'[ Range wildcard?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1113 beq L0745
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1114 L073D cmpa #'? Single char wildcard?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1115 beq L0745
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1116 cmpa #'* Multi-char wildcard?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1117 beq L0745
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1118 L0745 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1119
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1120 * Parse for next wildcard or special shell char in pre-parsed parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1121 * Entry: X=current pos in pre-parse parm line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1122 * Exit: X=Same as entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1123 * IF WILDCARD CHAR FOUND:
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1124 * B=# chars to next wildcard/special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1125 * A=special char found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1126 * Carry bit set
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1127 * IF SPECIAL SHELL CHAR FOUND
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1128 * B=0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1129 * Carry bit clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1130 * A=special char found: CR ( ) , space ! # & ; < > ^ |
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1131 L0746 pshs x Save current parm ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1132 bra L0752 Parse for wildcard or special shell chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1133
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1134 L074A lda ,x+ Get char from parms
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1135 bsr L0739 Do wildcard char check
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1136 beq L0752 If wildcard char, skip over it & continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1137 leax -1,x not wildcard char, bump back to char after \
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1138 L0752 lda ,x+ Get char from parms
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1139 cmpa #'\ Wildcard quote char (do not expand next)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1140 beq L074A Yes, handle it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1141 lbsr L05D3 No, check for other special shell chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1142 beq L0770 Found one, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1143 bsr L0739 Check for wildcard char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1144 bne L0752 None, skip to next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1145 * One of the 3 wildcard chars found, process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1146 pshs a Save char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1147 tfr x,d Move parm ptr to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1148 subd 1,s Calc distance since last wildcard/special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1149 subd #$0001 -1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1150 puls a B=distance between wild/special chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1151 orcc #Carry Set Carry Flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1152 puls pc,x Exit with original parm ptr in X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1153
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1154 * Exit with B=0, Carry clear and A=special char found (which ends current
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1155 * 'chunk' being checked... can included CR)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1156 L0770 clrb Clear carry, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1157 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1158
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1159 * Expanded buffer full error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1160 L0773 comb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1161 ldb #E$BufSiz
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1162 L0776 pshs b,cc Preserve error code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1163 bsr L072F Close DIR path (if we had one)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1164 ldx <u004A Print text message (usually error msg)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1165 ldy <u004C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1166 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1167 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1168 puls b,cc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1169 lbra L0191 Exit with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1170
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1171 L0789 lda #C$CR Append CR to expanded filenames buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1172 bsr L0714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1173 ldy <u0052 Get expanded buffer size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1174 leax >u0E6D,u Point to start of expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1175 bsr L072F Close DIR path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1176 lds <u0050 Get back original stack ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1177 * At this point, expanded buffer is complete and ready to go (either through
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1178 * wildcard routine, or by simply copying the original parm buffer from user)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1179
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1180 * Main entry point for non-wildcard filename search/match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1181 * Entry: X=Ptr to start of expanded buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1182 L079B tst <u001E Echo required?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1183 beq L07A2 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1184 lbsr L021F Print out user entered parm line to std err
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1185 L07A2 tst <u0043 2=FALSE,0=TRUE, 1=??? (check current IF status,
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1186 beq L07B0 if any. If TRUE flag set, skip ahead)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1187 lbsr L0F69 Do checks for IF type statements
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1188 tsta Find match?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1189 lbpl L0F1D Yes, process IF type statement
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1190 L07AE clrb No error & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1191 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1192
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1193 * If current IF type statement has result TRUE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1194 L07B0 tst <u0045 ??? (Are we looking for a label for GOTO?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1195 beq L07E3 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1196 lda ,x+ Get char from buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1197 cmpa #'* Comment line?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1198 bne L07AE No, exit without error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1199 lbsr L091F Yes, get ptr to first non-space char into X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1200 leay >u0124,u Point to temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1201 lbsr L100B Copy label from X to Y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1202 lda ,x Get 1st char of label
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1203 cmpa #'\ '*\'? (Which means cancel impending GOTO)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1204 beq L07DB Yes, cancel GOTO
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1205 leax >u0BFC,u No, point to 80 byte buffer (GOTO label holder?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1206 clra default char to check against=NUL
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1207 L07CF cmpa #C$CR End of label?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1208 beq L07DB Yes, cancel GOTO search
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1209 lda ,x+ Get next char from buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1210 cmpa ,y+ Is it the label we are looking for?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1211 beq L07CF Keep checking till done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1212 bra L07AE No match, clear carry & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1213
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1214 * Cancelling GOTO search
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1215 L07DB clr <u0045 Flag we are NOT looking for label for GOTO
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1216 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1217 leas 2,s Eat stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1218 lbra L010D Reprint shell prompt, process from scratch
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1219
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1220 L07E3 bsr L07E7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1221 bra L083A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1222
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1223 L07E7 pshs x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1224 tst <u006C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1225 beq L0832
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1226 tst <u005C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1227 bne L07F5
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1228 tst <u001C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1229 beq L0832
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1230 L07F5 lda ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1231 cmpa #'*
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1232 beq L0832
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1233 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1234 ldy #$0000 Force temporarily to super-user
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1235 os9 F$SUser
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1236 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1237 leax >u0CBD,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1238 ldd #$0203
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1239 lbsr L0C79
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1240 bcs L0832
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1241 lbsr L00FB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1242 lda #$20
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1243 sta <$11,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1244 ldy #$0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1245 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1246 os9 I$Write
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1247 bcs L082D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1248 ldx ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1249 ldy #$0800
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1250 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1251 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1252 L082D lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1253 os9 I$Close
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1254 L0832
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1255 IFGT Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1256 ldy <u005A Get original user # back
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1257 os9 F$SUser Change user # to original
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1258 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1259 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1260
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1261 * Parse input line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1262 * Entry : X=Ptr to current char in line buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1263 L083A clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1264 sta <u0022 Flag we don't change priority for forked process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1265 sta <u0003 Clear out # pages of data mem for forked process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1266 sta <u000E Clear out signal code
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1267 leay >CmdList,pc Point to main command list
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1268 lbsr L08D1 Parse keywords from list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1269 bcs L08A0 Keyword found but generated error, done line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1270 cmpa #C$CR Is 1st non-keyword char a carriage return?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1271 beq L08A0 Yes, done line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1272 sta <u000C Save non-keyword char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1273 cmpa #'( Is it a 'start command group' char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1274 bne L087B No, try next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1275 leay >L000D,pc Point to 'Shell'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1276 sty <u0004 Save pointer to program to fork?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1277 leax 1,x Bump ptr past '('
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1278 stx <u0008 Save updated ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1279 L0860 inc <u000D Bump up # of command groups
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1280 L0862 leay >L0404,pc Point to command group symbols to parse
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1281 lbsr L08E9 Hunt down EOL, or '(' or ')' (skip quoted text)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1282 cmpa #'( Another group start?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1283 beq L0860 Yes, bump up # of command groups & continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1284 cmpa #') Group end?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1285 bne L0898 No, skip ahead (to print WHAT?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1286 dec <u000D Bump down # of command groups
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1287 bne L0862 Still more groups, continue parsing for them
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1288 lda #C$CR Append CR at end of command line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1289 sta -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1290 bra L087F Check for modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1291
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1292 L087B bsr L08A3 Check for valid path, do '<>', '#', '^' if needed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1293 bcs L08A0 No valid path found, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1294 * Found valid pathname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1295 L087F leay >L0408,pc Point to modifiers table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1296 bsr L08E9 Go parse for them
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1297 tfr x,d Move ')' ptr to D for SUB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1298 subd <u0008 Calculate size from 1st '(' to ')'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1299 std <u0006 Save size of group (could also be pathname-modifier)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1300 leax -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1301 leay >L03CF,pc Point to modifier branch table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1302 bsr L08D1 Go execute modifier routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1303 bcs L08A0 If error in modifier routine, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1304 ldy <u0004 Get ptr to first char we started at
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1305 L0898 lbne L0BCF Not proper, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1306 cmpa #C$CR Last char a carriage return?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1307 bne L083A No, start parsing again at current position
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1308 L08A0 lbra L0B96 Done processing line, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1309
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1310 * Entry: X=Ptr to text to check for valid device name (including '.' & '..')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1311 * Exit: Carry set if not a valid device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1312 * Carry clear if there was
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1313 * <u0004 = Ptr to first char where we started at
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1314 * <u0008 = Ptr to end of redirection/mem size/priority setting chars (if found)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1315 L08A3 stx <u0004 Save ptr to current char in input line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1316 bsr L08B6 Check for valid device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1317 bcs L08B5 None found, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1318 * Found valid device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1319 L08A9 bsr L08B6 Eat rest of valid pathlist
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1320 bcc L08A9 Keep going until we are done pathlist
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1321 leay >L03DE,pc Point to Command list starting at '<>>>'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1322 bsr L08D1 Call any redirection, mem size or priority routines
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1323 stx <u0008 Save ptr to where we are now (end of current set)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1324 L08B5 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1325
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1326 L08B6 os9 F$PrsNam Valid OS9 device name?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1327 bcc L08C7 Yes, point X to it & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1328 lda ,x+ Not valid, get first char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1329 cmpa #'. Is it a period?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1330 bne L08CB No, bad path name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1331 cmpa ,x+ Is it a double period?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1332 beq L08C9 Yes, leave src ptr pointing to name after '..'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1333 leay -1,x If single, bump ptr to name after '.'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1334 L08C7 leax ,y Point X to pathname in source
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1335 L08C9 clra No error & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1336 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1337
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1338 L08CB comb Error flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1339 leax -1,x Bump source ptr back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1340 ldb #E$BPNam Bad Path Name error & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1341 rts
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1342 * Entry: Y=ptr to command list (CmdList)
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1343 L08D1 bsr L0907 Go find 1st non-space char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1344 pshs y Save command list ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1345 bsr L092A Parse for keyword or special char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1346 bcs L08E2 If no keyword found, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1347 ldd ,y Keyword found, get offset
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1348 jsr d,y Go execute routine for command found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1349 puls y Restore command list ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1350 bcc L08D1 No error, continue parsing for keywords
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1351 rts Subroutine had error, return with it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1352 L08E2 clra No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1353 lda ,x Get character (not in command list)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1354 puls pc,y Restore command list ptr & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1355
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1356 * Start searching at beginning of current command list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1357 * For looking for single character modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1358 L08E7 puls y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1359 L08E9 pshs y Preserve command list ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1360 lda ,x+ Get next char from command line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1361 L08ED tst ,y Check current char in command list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1362 bmi L08E7 If done list, start over at beginning
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1363 cmpa #'" Is it quotes?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1364 bne L0901 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1365 L08F5 lda ,x+ Get next char from command line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1366 cmpa #C$CR EOL?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1367 beq L0905 Yes, exit with A being CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1368 cmpa #'" Is it another set of quotes?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1369 bne L08F5 No, keep looking for it (or EOL)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1370 lda ,x+ Get char after 2nd quotes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1371 L0901 cmpa ,y+ Is it the current command char we are checking?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1372 bne L08ED No, try next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1373 L0905 puls pc,y Yes, exit with A containing it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1374
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1375 * Entry: Y=ptr to command list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1376 L0907 pshs x Preserve X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1377 lda ,x+ Get char from line entered by user
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1378 cmpa #C$SPAC Is it a space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1379 beq L091D Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1380 cmpa #', Is it a comma?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1381 beq L091D Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1382 leax >L0408,pc Point to single character modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1383 L0917 cmpa ,x+ Found a match?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1384 bhi L0917 No, try next until list is done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1385 puls pc,x Found it, restore X to point to it & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1386
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1387 L091D leas 2,s Eat X off the stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1388 L091F lda #C$SPAC Get space character
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1389 L0921 cmpa ,x+ Keep searching until non-space char is found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1390 beq L0921
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1391 leax -1,x Point to 1st non-space char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1392 * ; (1st pass) comes here
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1393 CmdSEMI andcc #^Carry No carry & return
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1394 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1395 * Command line parser
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1396 L092A pshs y,x Preserve command table ptr & input line ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1397 leay 2,y Skip first offset
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1398 L092E ldx ,s Get input line ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1399 L0930 lda ,x+ Get char from input line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1400 lbsr L0F0C Convert char to uppercase if lowercases
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1401 eora ,y+ Check for a match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1402 lsla
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1403 bne L0951 No match, skip to next keyword in table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1404 bcc L0930 Keep checking until end of keyword (high bit set)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1405 lda -$01,y Get command table char again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1406 cmpa #'|+$80 '|' (with high bit set)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1407 beq L094E Yes, exit with carry clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1408 cmpa #'^+$80 '^' (with high bit set)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1409 beq L094E Yes, exit with carry clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1410 cmpa #'A+$80 Any of the other special modifiers with high bit?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1411 blo L094E Yes, exit with carry clear
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1412 bsr L0907 Eat spaces until first non-space char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1413 bcs L0951 If special char (!|#,etc.), skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1414 L094E clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1415 puls pc,y,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1416
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1417 L0951 leay -1,y Bump search ptr back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1418 L0953 lda ,y+ Get char again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1419 bpl L0953 Keep getting them until end of keyword
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1420 sty 2,s Save ptr to next offset on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1421 ldd ,y++ Get offset
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1422 bne L092E If not at end of table, keep searching
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1423 comb End of table, command not found error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1424 puls pc,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1425
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1426 L0961 fcc 'startup'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1427 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1428
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1429 * Create child shell to run 'startup' file
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1430 CmdSTARTUP
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1431 pshs u,y,x Preserve regs
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1432 leax L000D,pc Point to 'shell' (module name)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1433 leau L0961,pc Point to 'startup' (parameter for 'shell')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1434 ldy #$0008 Size of 'startup<CR>'
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1435 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1436 ldd #$111F Program+Objct / 7.5K data area
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1437 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1438 ldd #$1102 Program+Objct / 512 byte data area
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
1439 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1440 os9 F$Fork Fork a shell to run the startup file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1441 bcs L0983 Couldn't fork, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1442 os9 F$Wait Wait until 'startup' is done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1443 L0983 puls u,y,x Restore regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1444 clrb No error & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1445 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1446
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1447 * EX command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1448 CmdEX lbsr L08A3 Go check for valid device name (module)
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1449 bcs L09AB If none, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1450 clra Std in path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1451 bsr L09B0 Go close it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1452 bsr L09AF Go close Std out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1453 bsr L09AF Go close Std Err
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1454 lbsr L0B87 Go find the end of the input line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1455 leax 1,x Bump ptr to 1 past CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1456 tfr x,d Move ptr to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1457 subd <u0008 Calculate size of current command group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1458 std <u0006 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1459 lbsr L130A Point to module to chain&get its parm size, etc.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1460 leas >u00FF,u Point stack to end of DP
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1461 os9 F$Chain Chain to the new program
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1462 lbra L01FA Couldn't, go here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1463 L09AB clrb No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1464 lbra L020D Close logging file (if any) and exit ShellPlus
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1465
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1466 L09AF inca Inc path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1467 L09B0 pshs a Save path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1468 lbra L0BBC close path if it is open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1469 * CHX & CX commands
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1470 CmdCHX clr <u0038
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1471 lda #DIR.+EXEC.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1472 os9 I$ChgDir
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1473 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1474 * CHD & CD commands
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1475 CmdCHD lda #DIR.+READ. (bug fix, originally opened in UPDATE)
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1476 os9 I$ChgDir Change the directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1477 bcs L09CE Error, exit with it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1478 clr <u0037 Flag .pwd entry as invalid
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1479 tst <u0042 WAS ,U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1480 beq L09CE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1481 bsr L0A04 Go update shell expanded prompt if needed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1482 L09CE rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1483 * L command - Logging ON
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1484 CmdL lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1485 bra L09D4
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1486 * -L command - Logging OFF
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1487 CmdNL clra
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1488 L09D4 sta <u001C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1489 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1490 * P command - Prompting ON
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1491 CmdP clra
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1492 bra L09DC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1493 * -P command - Prompting OFF
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1494 CmdNP lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1495 L09DC sta <u001D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1496 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1497 * T command - Echo input ON
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1498 CmdT lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1499 bra L09E4
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1500 * -T command - Echo input OFF
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1501 CmdNT clra
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1502 L09E4 sta <u001E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1503 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1504 * V command - Turn variable expansion ON
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1505 CmdV clra
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1506 bra L09EC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1507 * -V command - Turn variable expansion OFF
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1508 CmdNV lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1509 L09EC sta <u001F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1510 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1511 * X command - Kill Shell when error occurs ON
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1512 CmdX lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1513 bra L09F4
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1514 * -X command - Kill Shell when error occurs OFF
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1515 CmdNX clra
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1516 L09F4 sta <u0020
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1517 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1518
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1519 L09F7 tst >u01F4,u Date already done?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1520 bne L0A04 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1521 tst >u01F5,u Time already done?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1522 bne L0A04 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1523 rts If neither, we don't need to change prompt?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1524 L0A04 pshs y,x Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1525 bra L0A64 Go update shell expanded prompt if needed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1526
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1527 * Make shell prompt string the default one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1528 L0A08 puls y Restore Y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1529 pshs x Preserve X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1530 leax >L003D,pc Point to default prompt string
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1531 bsr CmdPEq Put that into working shell prompt string
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1532 puls pc,x Restore X & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1533
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1534 * P= (prompt set) command
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1535 * Make shell prompt string (default or user-specified)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1536 * Entry: X=ptr to source of new shell prompt string
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1537 CmdPEq pshs y Preserve Y
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1538 leay >u01F9,u Point to working prompt text buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1539 ldd #C$LF*256+22 Line feed & max count for prompt string+1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1540 sta ,y+ Save LF as first char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1541 bsr L0A25 Go copy prompt string (& parse quotes)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1542 bra L0A5E Go see if we need to override with default
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1543
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1544 L0A25 clr >u01F3,u Clear quotes in progress flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1545 L0A29 lda ,x+ Get char from default shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1546 cmpa #'" Is it a quotes?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1547 bne L0A3F No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1548 leax 1,x Yes, bump ptr up 2 past quotes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1549 tst >u01F3,u We processing quotes already?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1550 bne L0A59 Yes, we are done then
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1551 inc >u01F3,u Set processing quotes flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1552 leax -1,x Set ptr back to char just after quotes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1553 bra L0A29 Check next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1554
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1555 L0A3F cmpa #C$CR Carriage return?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1556 beq L0A59 Yes, we are done then
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1557 cmpa #C$SPAC Space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1558 beq L0A4B Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1559 cmpa #'; Semi-colon?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1560 bne L0A51 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1561 * Semi-colon or space found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1562 L0A4B tst >u01F3,u We quoting at the moment?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1563 beq L0A59 No, we are done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1564 L0A51 tstb Char count down to 0?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1565 beq L0A29 Yes, continue parsing (but eating them)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1566 decb Dec max char counter
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1567 sta ,y+ Save literal char into current copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1568 bra L0A29 continue parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1569
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1570 L0A59 clr ,y Append NUL to indicate end of string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1571 leax -1,x Bump source ptr back to last char & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1572 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1573
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1574 L0A5E cmpb #22 Did the user do a no-length prompt?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1575 beq L0A08 Yes, go override with default prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1576 pshs x Preserve ptr to last char of source prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1577
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1578 * Create expanded shell prompt from shell prompt string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1579 L0A64 leay >u01F9,u Point to shell prompt string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1580 leax >u0212,u Point to expanded prompt buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1581 pshs x Preserve it a moment
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1582 clr >u01F2,u Output device name done already = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1583 clr >u01F1,u Process ID # done already = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1584 clr >u01F4,u Date done already = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1585 clr >u01F5,u Time done already = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1586 clr >u01F6,u Date OR time already done once = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1587 clr >u0042,u Current working dir name done already = OFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1588 L0A86 lda ,y+ Get char from shell prompt string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1589 lbeq L0B29 If end of string, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1590 cmpa #'# Process ID # wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1591 bne L0AA2 No, try next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1592 * Process ID #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1593 tst >u01F1,u Done it already?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1594 bne L0A86 Yes, skip doing it again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1595 inc >u01F1,u No, flag it as being done now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1596 ldd >u01EC,u Get process # (01-99)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1597 std ,x++ Save in expanded prompt buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1598 bra L0A86 Continue parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1599 L0AA2 cmpa #'@ Standard output path device name wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1600 beq L0AAA Yes, go do it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1601 cmpa #$E0 High bit version?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1602 bne L0AC7 No, try next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1603 * Standard output path device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1604 L0AAA tst >u01F2,u Done it already?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1605 bne L0A86 Yes, skip doing it again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1606 ldd #$01*256+SS.DevNm Standard out/get device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1607 os9 I$GetStt Get the device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1608 bcs L0A86 Error, skip doing device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1609 inc >u01F2,u Flag it as being done now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1610 L0ABD lda ,x+ Get char from device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1611 bpl L0ABD Keep looking until last char (high bit set)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1612 anda #$7F Mask out high bit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1613 sta -1,x Save the normal char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1614 bra L0A86 Continue parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1615 L0AC7 cmpa #'$ Current working directory wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1616 bne L0AF2 No, check next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1617 * Current working directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1618 tst <u0042 Done it already? (WAS ,U)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1619 bne L0A86 Yes, skip doing it again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1620 inc <u0042 Flag it as being done now (WAS ,U)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1621 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1622 sta <u003D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1623 lbsr L176D Go figure out current working directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1624 tstb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1625 bne L0AF2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1626 pshs y Save prompt string ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1627 ldy <u002A Get pointer to current working directory
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1628 * Copy string: Y=source string ptr, X=prompt buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1629 L0AE4 lda ,y+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1630 sta ,x+ Save as part of shell prompt text
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1631 cmpa #C$CR Was it the end?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1632 bne L0AE4 No, keep copying
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1633 leax -1,x Bump ptr back CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1634 puls y Restore source string ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1635 bra L0A86 Continue parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1636
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1637 L0AF2 cmpa #'( Current Date wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1638 bne L0B0A No, check next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1639 * Current date
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1640 tst >u01F4,u Done it already?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1641 bne L0A86 Yes, skip doing it again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1642 inc >u01F4,u Flag as being done now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1643 bsr L0B3B Go get date & time
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1644 pshs y Save shell prompt string ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1645 leay >u02E0,u Point to date text
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1646 bra L0AE4 Copy into expanded prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1647 L0B0A cmpa #') Current Time wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1648 bne L0B24 No, just store the raw ASCII char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1649 * Current time
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1650 tst >u01F5,u Done Time already?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1651 lbne L0A86 Yes, skip doing it again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1652 inc >u01F5,u Flag as being done now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1653 bsr L0B3B Go get date & time
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1654 pshs y Save shell prompt string ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1655 leay >u02E9,u Point to time text
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1656 bra L0AE4 Copy into expanded prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1657
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1658 L0B24 sta ,x+ Save raw character
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1659 lbra L0A86 Continue parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1660
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1661 L0B29 sta ,x Save NUL to mark end of prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1662 tfr x,d Move End of prompt ptr to D for subtract
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1663 subd ,s++ Subtract start of prompt ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1664 std >u01F7,u Save size of expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1665 puls pc,y,x Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1666
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1667 * Separator table for date & time strings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1668 L0B35 fcc '//'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1669 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1670 fcc '::'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1671 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1672
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1673 * Get current date (2E0-2E8) & time (2E9-2EF)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1674 L0B3B pshs y,x Preserve shell prompt string & shell prompt ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1675 tst >u01F6,u Have we already been here before?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1676 bne L0B75 Yes, both date & time strings already done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1677 inc >u01F6,u Flag we have been here now
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1678 leax >u02DA,u Point to date/time packet buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1679 os9 F$Time Get the date/time packet
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1680 leay >u02E0,u Point to where date string goes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1681 clrb Offset into separator table to first '/'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1682 L0B54 lda ,x+ Get byte from time packet
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1683 bsr L0B77 Convert to ASCII
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1684 pshs b Preserve offset into separator table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1685 ldd >u01EF,u Get ASCII version of byte
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1686 std ,y++ Save into date/string buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1687 puls b Restore offset into separator table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1688 pshs y Preserve date/string buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1689 leay >L0B35,pc Point to separator's table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1690 lda b,y Get current separator
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1691 puls y Restore date/string buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1692 sta ,y+ Save separator into date/string buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1693 incb Point to next separator
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1694 cmpb #6 On last one?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1695 bne L0B54 No, continue converting
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1696 L0B75 puls pc,y,x Restore prompt & buffer ptrs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1697
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1698 L0B77 pshs y,x,d Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1699 leay >L0B80,pc Point to routine to copy ASCII digits
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1700 lbra L16B9 Go convert byte to ASCII equivalent
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1701
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1702 L0B80 ldd $04,s Copy 2 digit ASCII # to 1EF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1703 std >u01EF,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1704 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1705
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1706 * Searches for CR in string pointed to by X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1707 * '*' Comment lines come here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1708 L0B87 lda #C$CR We want to find the CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1709 L0B89 cmpa ,x+ Found it yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1710 bne L0B89 No, keep looking
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1711 cmpa ,-x Set up flags & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1712 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1713
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1714 L0B90 pshs d,cc Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1715 lda #$01 Only do std in & out (not error)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1716 bra L0B9A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1717
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1718 * Any errors from any of the CmdList subroutines go here
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1719 * If child process had error/status code it goes here (u005D cleared,B=Status
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1720 * code)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1721 L0B96 pshs d,cc Preserve error code, flags & A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1722 lda #$02 # of paths to do
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1723 L0B9A sta <u001A Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1724 clra Start at path 0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1725 L0B9D bsr L0BA8 Go close (possibly dupe) paths
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1726 inca Next path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1727 cmpa <u001A Done up to last one yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1728 bls L0B9D No, do next one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1729 * POSSIBLY COULD BE PULS PC,D,CC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1730 ror ,s+ Eat CC but shift Carry bit into Carry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1731 puls pc,d Restore error code & A & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1732
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1733 L0BA8 pshs a Save path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1734 tst <u0019
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1735 bmi L0BC4 If high bit set, close path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1736 bne L0BBC If 0<u0019<128, get changed path # & close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1737 tst a,u Check 'real' path # from DP
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1738 beq L0BC7 If 0, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1739 os9 I$Close Otherwise, close current path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1740 lda a,u Get 'real' path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1741 os9 I$Dup Dupe it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1742
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1743 * Close path # on stack, if it is open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1744 L0BBC ldb ,s Get path # from stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1745 lda b,u Get real path # from DP
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1746 beq L0BC7 If none, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1747 clr b,u Clear out path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1748 L0BC4 os9 I$Close Close the path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1749 L0BC7 puls pc,a Exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1750
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1751 L0BC9 fcc 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1752 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1753
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1754 L0BCF bsr L0B96 Close 3 std paths (possibly dupe)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1755 leax <L0BC9,pc Point to 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1756 lbsr L021B Write it out std err
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1757 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1758 coma
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1759 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1760
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1761 L0BDA inc <u0019 ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1762 bsr L0B96 Do path closings (possibly dupings)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1763 lda #$FF Set flag to just close raw paths
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1764 sta <u0019
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1765 bsr L0B90 Go close std in & std err
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1766 leax <u006D,u Point to device name buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1767 lbsr L0CDB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1768 lbcs L0200
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1769 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1770 bsr L0BA8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1771 lbsr L0CFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1772 clr <u0019
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1773 lbra L00CC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1774 * < processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1775 CmdIn ldd #$0001
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1776 orb <u000F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1777 bra L0C1A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1778 * >> processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1779 CmdErr ldd #$020D
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1780 stb -$02,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1781 bra L0C0A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1782 * > processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1783 CmdOut lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1784 L0C0A ldb #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1785 bra L0C1A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1786 * if from z= or i=, A=0, B=3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1787 L0C0E tst a,u Test duped path?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1788 bne L0BCF There is one, print 'WHAT' & close paths & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1789 pshs d Save path # & B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1790 tst <u0019
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1791 bmi L0C34
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1792 bra L0C24
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1793
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1794 L0C1A tst a,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1795 bne L0BCF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1796 pshs d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1797 ldb #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1798 stb -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1799
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1800 L0C24 os9 I$Dup Create duplicate of the standard path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1801 lbcs L0CBE Couldn't create dupe,
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1802 ldb ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1803 sta b,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1804 lda ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1805 os9 I$Close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1806
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1807 L0C34 lda 1,s Get B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1808 bmi L0C40
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1809 ldb ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1810 lbsr L0D05
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1811 tsta
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1812 bpl L0C47
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1813 L0C40 anda #$0F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1814 os9 I$Dup
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1815 bra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1816 L0C47 ldb #$0B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1817 bita #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1818 bne L0C7B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1819 pshs a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1820 ldd ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1821 andb #$5F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1822 cmpd #$2F57 Is it '/W'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1823 puls a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1824 bne L0C74
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1825 ora #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1826 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1827 bcs L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1828 pshs x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1829 leax >L003C,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1830 ldy #$0001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1831 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1832 os9 I$Write
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1833 puls x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1834 bra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1835 L0C74 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1836 bra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1837 L0C79 pshs d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1838 L0C7B stb <u004E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1839 ldb ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1840 cmpb #$2B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1841 bne L0C96
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1842 leax $01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1843 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1844 bcs L0CB1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1845 pshs u,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1846 ldb #SS.Size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1847 os9 I$GetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1848 os9 I$Seek
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1849 bra L0CA8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1850 L0C96 cmpb #'-
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1851 bne L0CB9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1852 leax 1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1853 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1854 bcs L0CB1 Error opening
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1855 pshs u,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1856 ldx #$0000
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1857 tfr x,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1858 L0CA8 ldb #SS.Size Init size of file to 0 bytes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1859 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1860 puls u,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1861 bra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1862 L0CB1 cmpb #E$PNNF Error 216 (path name not found)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1863 beq L0CB9 Yes, create the file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1864 orcc #Carry Otherwise, set error flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1865 bra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1866 L0CB9 ldb <u004E Get file attributes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1867 os9 I$Create
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1868
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1869 L0CBE sta <u0012 Save path # (or one we tried to duplicate?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1870 stb 1,s Save possible error code?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1871 lda #$00 DO NOT CHANGE-NEED TO PRESERVE CARRY
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1872 sta <u000F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1873 puls pc,d Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1874 L0CC8 ldd #$0003 Std in & ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1875 lbra L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1876 * <>>> processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1877 CmdIOE lda #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1878 sta -$04,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1879 * i= & z= both come here right off the bat
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1880 L0CD2 bsr L0CDB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1881 bcc L0CFF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1882 L0CD6 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1883 * <> processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1884 CmdIO lda #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1885 sta -$02,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1886
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1887 L0CDB bsr L0CC8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1888 bcs L0CD6
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1889 ldd #$0180
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1890 lbra L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1891 * <>> processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1892 CmdIE lda #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1893 sta -$03,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1894 bsr L0CC8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1895 bcs L0CD6
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1896 ldd #$0280
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1897 lbra L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1898 * >>> processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1899 CmdOE lda #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1900 sta -$03,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1901 ldd #$0102
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1902 lbsr L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1903 bcs L0CD6
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1904 L0CFF ldd #$0281
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1905 lbra L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1906 L0D05 pshs x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1907 ldd ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1908 cmpd #$2F30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1909 bcs L0D2F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1910 cmpd #$2F32
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1911 bhi L0D2F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1912 pshs x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1913 lbsr L0907
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1914 puls x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1915 bcs L0D2F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1916 andb #$03
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1917 cmpb 1,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1918 bne L0D31
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1919 ldb b,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1920 L0D26 orb #$80
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1921 stb ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1922 puls d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1923 leas 2,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1924 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1925 L0D2F puls pc,x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1926
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1927 L0D31 tst $01,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1928 bne L0D26
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1929 pshs x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1930 tfr b,a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1931 leax >u00B5,u Point to buffer for device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1932 ldb #'/ Put a slash in it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1933 stb ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1934 ldb #SS.DevNm Get the device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1935 os9 I$GetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1936 bcs L0D4F Error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1937 leax -1,x Reset ptr to include '/'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1938 lda #UPDAT.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1939 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1940 L0D4F puls x Restore ptr to beginning (including '/')
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1941 leas 6,s Eat stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1942 lbra L0CBE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1943
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1944 L0D56 fcc 'TRUE '
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1945 L0D5B fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1946 L0D5C fcc 'FALSE'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1947 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1948
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
1949 CmdIF lda ,x+
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1950 cmpa #'[
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1951 bne L0D6B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1952 lbsr L0E15
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1953 L0D6B cmpa #'-
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1954 lbne L0E3E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1955 ldb ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1956 lbsr L0E15
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1957 leax -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1958 tfr b,a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1959 lbsr L0F0C Convert char to uppercase if lower
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1960 cmpa #'Y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1961 bne L0DBB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1962 L0D81 pshs x Preserve X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1963 leax >u0124,u Point to buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1964 ldy #$0001 Read 1 byte from error path???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1965 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1966 os9 I$Read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1967 lbcs L0F17
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1968 lda ,x Get the character read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1969 puls x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1970 lbsr L0F0C Convert char to uppercase if lower
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1971 cmpa #'Y Unless char is Y or N, re-read it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1972 beq L0DA3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1973 cmpa #'N
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1974 bne L0D81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1975 L0DA3 pshs a Preserve char on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1976 leax >L0D5B,pc Point to a Carriage return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1977 lda #$02 Print it to std out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1978 ldy #$0001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1979 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1980 puls a Restore char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1981 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1982 cmpa #'Y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1983 beq L0DF8 Print 'true' if it is a Y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1984 bra L0DEE Print 'false' if it is a N
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1985
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1986 L0DBB clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1987 cmpa #'F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1988 beq L0DE0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1989 cmpa #'E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1990 bne L0DC8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1991 orb #%00000100
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1992 bra L0DE0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1993
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1994 L0DC8 cmpa #'R
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1995 bne L0DD0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1996 orb #%00000001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1997 bra L0DE0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1998
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
1999 L0DD0 cmpa #'W
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2000 bne L0DD8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2001 orb #%00000010
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2002 bra L0DE0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2003
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2004 L0DD8 cmpa #'D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2005 lbne L0F17
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2006 orb #%10000000
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2007 L0DE0 tfr b,a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2008 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2009 bcs L0DEE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2010 os9 I$Close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2011 bra L0DF8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2013 L0DEE lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2014 sta <u0043
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2015 leax >L0D5C,pc Point to 'FALSE'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2016 bra L0DFE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2017
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2018 L0DF8 clr <u0043
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2019 leax >L0D56,pc Point to 'TRUE'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2020 L0DFE tst <u001E Command echo on?
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2021 beq CmdTHEN No, skip ahead
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2022 ldy #$0006 Print result of IF to std error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2023 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2024 os9 I$WritLn
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2025 CmdTHEN leax >u0124,u
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2026 lda #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2027 sta ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2028 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2029 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2030
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2031 L0E15 lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2032 cmpa #C$SPAC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2033 beq L0E15
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2034 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2035
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2036 L0E1C cmpa #$3D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2037 bne L0E26
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2038 lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2039 ora #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2040 bra L0E38
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2041
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2042 L0E26 cmpa #'<
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2043 bne L0E30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2044 lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2045 ora #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2046 bra L0E38
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2047
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2048 L0E30 cmpa #'>
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2049 bne L0E3C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2050 * X command - Kill Shell when error occurs ON
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2051 lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2052 ora #$04
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2053 L0E38 sta <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2054 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2055 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2056
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2057 L0E3C coma
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2058 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2059
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2060 L0E3E cmpa #'+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2061 bne L0E46
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2062 inc <u0015
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2063 bra L0E48
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2064
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2065 L0E46 leax -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2066 L0E48 clr <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2067 pshs u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2068 leau >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2069 ldb #180 Clear out 180 bytes @ u0124
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2070 lbsr L0412
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2071 puls u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2072 leay >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2073 ldb #81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2074 L0E5D lda ,x+ Copy buffer up to CR or 81 chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2075 lbsr L0F0C Convert char to uppercase if lower
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2076 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2077 cmpa #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2078 lbeq L0F17
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2079 bsr L0E1C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2080 bcc L0E74
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2081 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2082 bne L0E5D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2083 lbra L0F17
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2084
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2085 L0E74 negb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2086 addb #81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2087 stb <u0016
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2088 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2089 sta -$01,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2090 lda ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2091 bsr L0E1C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2092 bcs L0E84
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2093 leax $01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2094 L0E84 leay >u0175,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2095 ldb #81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2096 L0E8A lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2097 bsr L0F0C Convert char to uppercase if lower
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2098 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2099 cmpa #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2100 beq L0E99
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2101 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2102 bne L0E8A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2103 bra L0F17
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2104
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2105 L0E99 negb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2106 addb #$51
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2107 stb <u0017
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2108 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2109 sta -$01,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2110 tst <u0015
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2111 beq L0EE0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2112 leax >u166D,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2113 ldd #$30b4 Store 180 ASCII 0's into buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2114 L0EAD sta ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2115 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2116 bne L0EAD
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2117 leax >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2118 ldb <u0016
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2119 leax b,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2120 leay >u16BD,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2121 bsr L0ED8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2122 leax >u0175,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2123 ldb <u0017
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2124 leax b,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2125 leay >u170E,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2126 bsr L0ED8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2127 leax >u166D,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2128 leay >u16BE,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2129 bra L0EE8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2130
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2131 L0ED8 lda ,-x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2132 sta ,-y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2133 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2134 bne L0ED8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2135 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2136
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2137 L0EE0 leax >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2138 leay >u0175,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2139 L0EE8 ldb #80
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2140 L0EEA lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2141 cmpa ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2142 blo L0EFB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2143 bhi L0F01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2144 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2145 bne L0EEA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2146 lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2147 bita #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2148 bra L0F05
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2149
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2150 L0EFB lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2151 bita #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2152 bra L0F05
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2153
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2154 L0F01 lda <u005F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2155 bita #$04
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2156 L0F05 lbne L0DF8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2157 lbra L0DEE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2158
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2159 * Convert char to uppercase if it is a letter
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2160 L0F0C cmpa #'a Lower case letter?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2161 blo L0F16 No, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2162 cmpa #'z Check high range
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2163 bhi L0F16 No, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2164 suba #$20 Yes, convert to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2165 L0F16 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2166
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2167 L0F17 comb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2168 ldb #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2169 lbra L0191
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2170
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2171 L0F1D cmpa #$03
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2172 beq CmdCLRIF
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2173 cmpa #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2174 bne L0F2B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2175 dec <u0044
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2176 blt CmdCLRIF
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2177 bra L0F43
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2178
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2179 L0F2B cmpa #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2180 bne L0F3B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2181 lda <u0043
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2182 cmpa #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2183 bne L0F43
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2184 tst <u0044
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2185 beq CmdCLRIF
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2186 bra L0F43
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2187
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2188 L0F3B inc <u0044
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2189 bra L0F43
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2190
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2191 CmdCLRIF clr <u0043
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2192 clr <u0044
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2193 L0F43 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2194 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2195
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2196 * Table: 7 bytes/entry:
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2197 * 1st 5 bytes is name, high bit set & NUL padded
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2198 * Byte 6 is # bytes actually used
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2199 L0F45 fcs 'IF'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2200 fcb 0,0,0,2,0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2201 fcs 'ELSE'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2202 fcb 0,4,1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2203 fcs 'ENDIF'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2204 fcb 5,2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2205 fcs 'FI'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2206 fcb 0,0,0,2,2
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2207 fcs 'CLRIF'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2208 fcb 5,3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2209 fcb $ff
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2210
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2211 L0F69 leay <L0F45,pc Point to conditionals table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2212 L0F6D ldb 5,y Get actual length of string we are checking
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2213 os9 F$CmpNam Compare with string pointed to by X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2214 bcs L0F80 If they don't match, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2215 lda 6,y Get conditional token(?) number
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2216 ldb b,x Get char past end of matching string
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2217 cmpb #C$CR Is it a CR?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2218 beq L0F8B Yes, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2219 cmpb #C$SPAC Is it a space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2220 beq L0F8B Yes, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2221 L0F80 leay 7,y Point to next command in table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2222 lda ,y Get 1st char from this entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2223 cmpa #$FF End of table marker?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2224 beq L0F8B Yes, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2225 * NOTE: THIS INCA SEEMS TO BE USELESS, AS F$CMPNAM DOESN'T USE A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2226 inca No, ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2227 bra L0F6D Process this one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2228
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2229 CmdELSE lda #$01
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2230 sta <u0043
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2231 lbra CmdTHEN
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2232
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2233 CmdONERR lbsr L0907 Go find 1st non-space char or single char modifier
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2234 bne L0F9B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2235 clr <u0046
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2236 L0F8B rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2237
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2238 L0F9B leay >L03AC,pc Point to 'GOTO'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2239 ldb #4 4 chars to compare
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2240 os9 F$CmpNam Does it match?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2241 lbcs L0BCF No, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2242 leax 4,x Yes, skip X past 'GOTO'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2243 lbsr L091F Go find 1st non-space char past 'GOTO'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2244 leay >u0C4C,u Point to some sort of buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2245 lda ,x Get char from GOTO label
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2246 cmpa #'+ Is label after current pos. in script file?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2247 bne L0FBB No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2248 sta ,y+ Save '+' in buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2249 leax 1,x Bump up source ptr past '+'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2250 L0FBB bsr L100B Go copy label name into buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2251 inc <u0046 Set flag that a GOTO was found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2252 L0FBF lda ,x+ Get 1st char from user's label again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2253 leay >L0408,pc Point to single char modifiers table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2254 L0FC5 cmpa ,y+ Illegal modifier char in label name?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2255 bhi L0FC5 Not yet, check other modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2256 blo L0FBF This char ok, check rest of label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2257 leax -1,x Point to last char (terminator) of label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2258 stx <u0058 Save it & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2259 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2260
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2261 CmdGOTO lda ,x
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2262 cmpa #'+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2263 bne L0FDA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2264 leax 1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2265 bra L0FFB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2266 L0FDA tst <u006B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2267 beq L0FEA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2268 ldy <u0067
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2269 ldd $09,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2270 leay d,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2271 sty <u0065
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2272 bra L0FFB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2273 L0FEA pshs u,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2274 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2275 ldx #$0000 Seek to beginning
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2276 tfr x,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2277 os9 I$Seek
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2278 puls u,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2279 lbcs L0191
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2280 L0FFB lbsr L091F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2281 leay >u0BFC,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2282 bsr L100B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2283 lda #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2284 sta ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2285 inc <u0045
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2286 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2287
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2288 * Copy label from X to buffer @ Y, terminate at 1st illegal char with CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2289 * Exit: X=ptr to start of label name from user's buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2290 * Y=ptr to start of buffer entry copy of label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2291 L100B pshs y,x Preserve buffer & source ptrs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2292 ldb #79 (78 bytes to check)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2293 L100F decb Dec # chars left to check
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2294 beq L1022 If done max, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2295 lda ,x+ Get char for label
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2296 sta ,y+ Save in buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2297 cmpa #'A Is it a letter or higher?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2298 bhs L100F Yes, continue copying
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2299 cmpa #'0 Is it lower than a #?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2300 blo L1022 Yes, not allowed, force end of label name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2301 cmpa #'9 Is it a #?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2302 bls L100F Yes, that is fine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2303 L1022 lda #C$CR All others illegal, force CR in buffer copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2304 sta -1,y Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2305 clrb No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2306 puls pc,y,x Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2307
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2308 * M= command (???)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2309 CmdMEq ldb #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2310 stb -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2311 tst <u006B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2312 bne L1057
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2313 tst <u006C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2314 bne L1057
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2315 lda #Data Data module type
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2316 pshs u,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2317 os9 F$Link
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2318 bcs L1055
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2319 stu <u0067 Save start address of module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2320 sty <u0065 Save execution address of module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2321 ldd 2,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2322 addd <u0067
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2323 subd #$0003
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2324 std <u0069
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2325 inc <u006B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2326 puls u,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2327 leax -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2328 lbra L0907
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2329
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2330 L1055 puls u,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2331 L1057 lbra L0BCF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2332
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2333 * VAR. command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2334 CmdVAR leay >u05A8,u
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2335 lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2336 cmpa #'?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2337 beq L10C9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2338 cmpa #'=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2339 beq L1096
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2340 cmpa #C$SPAC
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2341 beq L1085
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2342 cmpa #';
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2343 beq L1085
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2344 cmpa #'9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2345 bhi L1085
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2346 cmpa #'0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2347 bcs L1085
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2348 suba #$30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2349 ldb #$51 Multiply by 81 (size of each VAR entry)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2350 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2351 leay d,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2352 lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2353 cmpa #'=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2354 beq L1096
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2355 L1085 leax -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2356 pshs x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2357 tfr y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2358 ldy #$0051
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2359 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2360 os9 I$ReadLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2361 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2362
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2363 L1096 ldb #80
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2364 lbsr L0A25
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2365 lda #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2366 sta ,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2367 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2368
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2369 L10A0 fcb C$LF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2370 fcc 'User Variables :'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2371 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2372
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2373 L10B2 fcb C$LF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2374 fcc 'Shell Sub Variables :'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2375 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2376
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2377 L10C9 pshs x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2378 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2379 leax >L10A0,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2380 bsr L10DF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2381 leay >u08D2,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2382 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2383 leax >L10B2,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2384 bsr L10DF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2385 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2386
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2387 L10DF pshs y,b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2388 lbsr L021B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2389 puls y,b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2390 L10E6 pshs y,b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2391 lda #$51
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2392 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2393 leay d,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2394 leax >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2395 ldd #'V*256+'A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2396 std ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2397 ldd #'R*256+'.
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2398 std ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2399 lda ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2400 L10FD adda #$30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2401 ldb #'=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2402 std ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2403 L1103 lda ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2404 sta ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2405 cmpa #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2406 bne L1103
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2407 leax >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2408 ldy #$0057
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2409 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2410 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2411 puls y,b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2412 bcs L1122
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2413 incb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2414 cmpb #C$LF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2415 bcs L10E6
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2416 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2417
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2418 L1122 puls y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2419 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2420
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2421 * INC. command (increment shell variable by 1)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2422 CmdINC bsr L1144
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2423 lbcs L0191
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2424 addd #$0001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2425 bra L113A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2426
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2427 * DEC. command (decrement shell variable by 1)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2428 CmdDEC bsr L1144
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2429 lbcs L0191
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2430 subd #$0001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2431 L113A bsr L11A7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2432 lda #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2433 sta $05,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2434 ldx <u0048
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2435 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2436 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2437
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2438 L1144 inc <u0014
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2439 leay >u05A8,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2440 lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2441 stx <u0048
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2442 cmpa #'0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2443 bcs L1161
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2444 cmpa #'9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2445 bhi L1161
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2446 suba #$30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2447 ldb #81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2448 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2449 leay d,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2450 tfr y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2451 bra L1166
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2452
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2453 L1161 leas 2,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2454 lbra L0BCF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2455
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2456 L1166 pshs y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2457 leas -$05,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2458 tfr s,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2459 clr $03,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2460 clr $04,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2461 L1170 clr $02,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2462 lda ,x+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2463 suba #$30
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2464 cmpa #$09
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2465 bhi L1195
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2466 pshs a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2467 lda #10
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2468 ldb $03,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2469 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2470 std ,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2471 lda $04,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2472 ldb #10
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2473 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2474 addd $01,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2475 std $01,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2476 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2477 puls b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2478 addd $01,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2479 std $03,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2480 bra L1170
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2481
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2482 L1195 ldd 3,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2483 leas 5,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2484 puls pc,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2485
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2486 * 2 byte ASCII conversion table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2487 L119B fdb 10000
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2488 fdb 1000
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2489 fdb 100
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2490 fdb 10
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2491 fdb 1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2492 fdb 0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2493
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2494 L11A7 pshs y,x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2495 pshs b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2496 leax >L119B,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2497 L11AF pshs d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2498 ldb #'/
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2499 stb 2,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2500 puls d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2501 L11B7 inc ,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2502 subd ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2503 bcc L11B7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2504 addd ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2505 pshs d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2506 ldb $02,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2507 stb ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2508 lda $01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2509 puls d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2510 bne L11AF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2511 puls b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2512 puls pc,y,x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2513
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2514 * PAUSE command - may display text message, and then waits for key press or
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2515 * mouse button
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2516 CmdPAUSE ldy #394 Write up to 394 chars of pause string
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2517 lda #$02 To standard error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2518 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2519 lbcs L0191
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2520 tfr y,d Tfr # chars written to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2521 leax d,x Point X to next char after ones written
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2522 leax -1,x Point to last char written
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2523 pshs x Save ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2524 ldd #$02*256+SS.SSig Std Err/Send signal when key pressed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2525 ldx #$000A Signal $A is the one to send
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2526 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2527 lbcs L0191 Error, use main shell error handler
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2528 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2529 ldb #SS.MsSig Send signal on mouse button press
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2530 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2531 lbcs L0191
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2532 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2533 ldx #$0000 Go to sleep until one of the 2 is received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2534 os9 F$Sleep
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2535 ldb #SS.Relea Signal gotten, release all signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2536 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2537 clrb No error & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2538 puls pc,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2539
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2540 * Parse PATH=, add paths to PATH buffer list
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2541 CmdPATHEq
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2542 pshs x Preserve ptr to string after 'PATH='
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2543 lda ,x Get 1st char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2544 cmpa #'? User requesting current paths?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2545 beq L1245 Yes, go do that
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2546 pshs u Preserve U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2547 leau >u0CDD,u Point to PATH= buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2548 L1217 lda ,x+ Get char from user-requested path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2549 cmpa #C$SPAC Space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2550 beq L1217 Yes, eat spaces until 1st real char found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2551 sta ,u+ No, save char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2552 L121F leay >L0408,pc Point to command modifier list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2553 L1223 cmpa ,y+ Match char?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2554 bhi L1223 No, our char is higher, check next modifier
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2555 beq L1237 Found match, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2556 lda ,x+ No modifier found, get next char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2557 sta ,u+ Save in PATH buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2558 cmpa #C$SPAC Was it a space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2559 bne L121F No, check this char vs. modifier list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2560 lda #C$CR Yes, change to CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2561 sta -1,u Save CR instead (terminate 1 path entry)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2562 bra L1217 Do whole list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2563
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2564 * NOTE: ANY modifier (not just CR, but ! # & ; < > ^ |) stops PATH=parsing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2565 L1237 leax -1,x Bump ptr back to last char from user
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2566 stx 2,s Save ptr on stack over original X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2567 lda #C$CR Get CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2568 sta -1,u Save CR as current path end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2569 sta ,u And 1 extra for parse routines
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2570 puls u Get U back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2571 puls pc,x Restore new X & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2572
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2573 L1245 leax >u0CDD,u Point to start of PATH=buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2574 L1249 ldy #400 Write up to 400 chars to standard out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2575 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2576 os9 I$WritLn Print text of one path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2577 lbcs L0191 Error, go process shell error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2578 tfr y,d Tfr # bytes written to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2579 leax d,x Offset X to end of what was printed
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2580 lda ,x Get char from there
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2581 cmpa #C$CR CR (end of path list)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2582 bne L1249 No, go write next path out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2583 puls x Restore ptr to next set of PATH=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2584 leax 1,x Bump ptr up by 1 & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2585 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2586
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2587 * ^ (set priority on the fly) command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2588 CmdCaret ldb #C$CR Plop a CR onto the end
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2589 stb -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2590 ldb <u0022 Any priority already set?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2591 lbne L0BCF Yes, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2592 lbsr L16EB Go calculate binary priority into B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2593 stb <u0022 Save priority to fork module with
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2594 lbra L0907 Continue processing for modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2595
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2596 * # (set data memory size) command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2597 CmdMem ldb #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2598 stb -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2599 ldb <u0003 Already have a data mem size set?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2600 lbne L0BCF Yes, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2601 lbsr L16EB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2602 eora #'K
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2603 anda #$DF Force uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2604 bne L1294 No 'K', just save # of 256 byte pages
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2605 leax 1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2606 lda #4 Multiply # of K by 4 to get # pages
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2607 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2608 tsta
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2609 lbne L0BCF Ended up too big, print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2610 L1294 stb <u0003 Save data mem size to use
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2611 lbra L0907 Continue processing command line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2612
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2613 * Carriage return processing
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2614 CmdCR leax -1,x
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2615 lbsr L145D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2616 bra L12A3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2617
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2618 * ; (separator) command (also called by others)
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2619 CmdSEMIC lbsr L1459
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2620 L12A3 bcs L12BA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2621 lbsr L0B96 Go do the path stuff
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2622 tst <u005D Is there a module that is unlinking?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2623 bne L12AE Yes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2624 bsr L12D2 Go wait for child process to die (A=process #)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2625
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2626 L12AE bcs L12BA If child exited with status/signal code,skip
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2627 lbsr L0907 Go parse for modifiers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2628 cmpa #C$CR Was the next non-space/comma char a CR?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2629 bne L12B9 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2630 leas 4,s Yes, eat stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2631 L12B9 clrb No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2632
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2633 * Child process had a signal/status code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2634 L12BA pshs cc Preserve error status
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2635 clr <u005D ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2636 puls cc Restore carry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2637 lbra L0B96 ??? Go close some paths & return?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2638
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2639 * & (background operation) command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2640 CmdAmp lbsr L1459
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2641 bcs L12BA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2642 bsr L12BA
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2643 ldb #$26
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2644 lbsr L16B3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2645 bra L12AE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2646
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2647 * W command - Wait for a child to die
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
2648 CmdW clra Clear process ID #
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2649 * Entered here if commands are separated with ';' (or '()' groups)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2650 L12D2 pshs a Save ID # of process?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2651 L12D4 os9 F$Wait Wait for child to die or until signal received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2652 tst <u000E Signal received (which would be in SHELL)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2653 beq L12EC No, child was exited (or got signal), go process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2654 * Shell was interrupted by signal while Waiting
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2655 ldb <u000E Get signal that we received
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2656 cmpb #S$Abort Was it a PD.QUT (<CTRL>-<E>) (quit 'W'aiting?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2657 bne L1304 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2658 lda ,s Get process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2659 beq L1304 None, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2660 os9 F$Send Send the signal to the child as well
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2661 clr ,s Clear process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2662 bra L12D4 Go Wait again (until child dies)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2663
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2664 * Child F$Exited or was aborted - eat should go here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2665 * Entry: A=ID # of deceased child
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2666 * B=Exit (error) code from child
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2667 L12EC lbcs L1308 If F$Wait exited with error, return with it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2668 cmpa ,s Same process # as one we were waiting for?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2669 beq L1304 Yes, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2670 tst ,s No, was there a specific process # we wanted?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2671 beq L12F9 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2672 * Child died, but not the one we were waiting for
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2673 tstb Was there an error status?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2674 beq L12D4 No, ignore dead child and wait for one we wanted
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2675 * Child died with error on exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2676 L12F9 pshs b Preserve child's exit status code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2677 bsr L12BA ??? Go close & re-dupe paths?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2678 ldb #'- Get a '-' (for a '-003' process finished msg)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2679 lbsr L16B3 Print that out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2680 puls b Get back exit status code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2681
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2682 L1304 tstb is there an Error/signal code?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2683 beq L1308 No, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2684 cmpb #S$Intrpt Yes, is it a keyboard interrupt signal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2685 beq eatchar Yes, eat the key
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2686 cmpb #S$Abort Keyboard abort signal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2687 bne errexit No, exit with unknown error/signal code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2688
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2689 * At this point, child died from signal 2 or 3 (CTRL-C or CTRL-E). The corres-
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2690 * ponding key is also sitting in this devices PD.BUF as the 1st char. We musts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2691 * 1) Disable keyboard signal & eat the key from the buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2692 * 2) Exit from here with Carry set & signal (2 or 3) in B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2693 eatchar pshs b,x,y Preserve signal code & regs used
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2694 ldd #SS.Ready Std in, check for data ready on device
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2695 os9 I$GetStt Check it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2696 bcs NotSCF No chars waiting on device, exit with signal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2697 lda <u0018 Is the shell immortal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2698 beq NotSCF No, don't try to eat the char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2699 eat clra Standard in path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2700 leas -PD.OPT,s Make 32 byte buffer for OPT's
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2701 leax ,s Point X to it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2702 clrb SS.Opt call
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2703 os9 I$GetStt Get current path options
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2704 lda ,x Get device type
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2705 beq Eatkey SCF (not script file) so go eat key
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2706 NoChar leas PD.OPT,s Eat temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2707 bra NotSCF Exit with signal code (script file got signal)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2708
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2709 * Have to eat key: Shut echo off 1st
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2710 Eatkey clr 4,x PD.EKO flag off
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2711 os9 I$SetStt Shut echo off
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2712 ldd #SS.Relea Std In, Release keyboard/mouse signals
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2713 os9 I$SetStt Shut signals off so we don't get stuck
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2714 leax ,-s Make 1 byte buffer on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2715 ldy #1 1 byte to read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2716 os9 I$Read Eat the char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2717 leas 1,s eat buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2718 ldd #SS.SSig Std In, send signal on key ready
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2719 ldx #$B Signal to send
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2720 os9 I$SetStt Turn keyboard signal on again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2721 leax ,s Point to temp buffer again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2722 inc 4,x PD.EKO flag on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2723 clra Std In
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2724 clrb Set Options
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2725 os9 I$SetStt Turn echo back on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2726 leas PD.OPT,s Deallocate temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2727 ldb u180D,u Get current history line #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2728 cmpb #1 First one?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2729 bhi Previous No, B=previous one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2730 ldb u180C,u Was on first, so get last
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2731 incb Adjust for dec
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2732 Previous decb Point to previous one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2733 lbsr L19D3 Go get ptr to history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2734 lda ,y Get 1st char from previous line in history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2735 sta ,x Save char there
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2736 ldd #SS.Fill Fill keyboard buffer call to Std In
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2737 ldy #$8001 1 char long, don't append CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2738 os9 I$SetStt Stick that key into the keyboard buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2739 NotSCF puls b,x,y Restore regs (and exit status byte in B)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2740 errexit coma Yes, set carry & exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2741 L1308 puls pc,a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2742
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2743 * Level 2: If data area <4.25K, force up to 7.5K
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2744 * Exit: A=Type/language
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2745 * X=Current source line parsing ptr (module name to chain)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2746 * Y=Size of parameter area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2747 * U=Ptr to parameter area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2748 * B=Size of data area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2749 L130A lda #Prgrm+Objct Module type/language
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2750 ldb <u0003 Get # pages of data mem needed for forked module
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2751 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2752 cmpb #$11 Is it at least 17?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2753 bhs L1316 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2754 ldb #$1F Otherwise, force to 7.5K minimum
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2755 stb <u0003 Save it
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2756 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2757 L1316 andcc #^Carry Clear carry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2758 ldx <u0004 Get mem module ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2759 ldy <u0006 Get size of current command group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2760 ldu <u0008 Get ptr to start of current command group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2761 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2762
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2763 * Copy string from X to Y until CR is hit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2764 L1320 lda ,x+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2765 sta ,y+ Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2766 cmpa #C$CR Carriage return?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2767 bne L1320 No, keep copying
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2768 rts Done, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2769
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2770 * Attempt load in module to execute (it's not in memory)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2771 * Entry: X=Ptr to module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2772 L1329 lda #EXEC. 1st, attempt to get it from current Exec DIR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2773 os9 I$Open Attempt to open it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2774 bcc L1362 Found it, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2775 * Possible search thru PATH= settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2776 inc <u000F ??? Set flag to indicate using PATH=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2777 leax >u0CDD,u Point to start of PATH= list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2778 L1336 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2779 lda ,x Get 1st char from next PATH= line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2780 cmpa #C$CR End of list?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2781 lbeq L1564 Yes, ???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2782 leay >u0124,u No, point to temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2783 bsr L1320 Copy path to temp buffer until CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2784 pshs x Preserve ptr to next possible path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2785 lda #'/ Add slash since we want file from this path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2786 sta -1,y Save at end of path in temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2787 ldx <u0004 Get ptr to module/script name we are looking for
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2788 bsr L1320 Copy it into temp buffer up to CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2789 leax >u0124,u Point to start of full path list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2790 lda #READ. Attempt to open file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2791 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2792 puls x Restore ptr to next possible path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2793 bcs L1336 Didn't find file there, try next path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2794 leax >u0124,u Point to full pathlist again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2795 stx <u0004 Replace ptr to module with full pathlist ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2796 L1362 leax >u00D6,u Point to buffer to hold beginning of file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2797 ldy #77 77 bytes to read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2798 os9 I$Read Read it in
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2799 bcc L1373 No error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2800 cmpb #E$EOF Just EOF error?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2801 bne L13CE No, something more serious, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2802 L1373 tst <u000F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2803 bne L137B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2804 ldb #$04
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2805 stb <u000F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2806 L137B pshs a Save path # a sec
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2807 ldd M$ID,x Get possible module header bytes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2808 cmpd #M$ID12 Legit module header?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2809 puls a Restore path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2810 beq L1396 OS9 module, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2811 * Not module...possible shell script?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2812 os9 I$Close Not OS9 module, close file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2813 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2814 dec <u000F Dec flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2815 lbeq L1564 If 0, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2816 inc <u000F If not, inc & skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2817 lbra L1564
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2818
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2819 * Seems to be OS9 module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2820 L1396 clr <u000F Clear flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2821 ldy M$Name,x Get offset to module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2822 leax >u00E3,u Point X to offset $E in module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2823 cmpy #$000D Does the name start at offset $D?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2824 beq L13C0 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2825 pshs u Preserve U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2826 tfr y,u Move name offset to U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2827 ldx #$0000 MSW of file pos=0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2828 os9 I$Seek Go seek to that spot in file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2829 puls u Restore U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2830 bcs L13CE Error seeking, go handle
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2831 ldy #64 Go read up to 64 char filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2832 leax >u00E3,u Point to spot to hold filename
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2833 os9 I$Read Read it in
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2834 bcs L13CE Error reading, go handle
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2835 L13C0 pshs a Save path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2836 os9 F$PrsNam Parse module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2837 puls a Restore path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2838 bcs L13CE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2839 cmpb #$40
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2840 bhi L1422
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2841 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2842 L13CE pshs b,cc Preserve error status
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2843 os9 I$Close Close file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2844 puls b,cc Restore error status
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2845 lbcs L162B If error, exit with it (S/B L162C)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2846 leax >u00D6,u Point to buffer holding 77 bytes of file
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2847 lda $06,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2848 ldy $0B,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2849 cmpa #$40
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2850 bne L1407
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2851 bsr L13EF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2852 lbcs L162B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2853 lbra L14AF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2854 L13EF leax >u00E3,u
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2855 IFGT Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2856 os9 F$NMLink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2857 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2858 pshs u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2859 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2860 puls u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2861 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2862 bcc L1400
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2863 ldx <u0004
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2864 IFGT Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2865 os9 F$NMLoad
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2866 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2867 pshs u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2868 os9 F$Load
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2869 puls u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2870 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2871 bcc L1400
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2872 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2873 L1400 leax >u00E3,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2874 stx <u0004
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2875 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2876 L1407 cmpa #$51
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2877 bne L1413
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2878 bsr L13EF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2879 lbcs L162B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2880 bra L1427
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2881 L1413 cmpa #$11
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2882 lbne L14D7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2883 leax >u00E3,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2884 stx <u0010
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2885 lbra L15D7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2886 L1422 lbsr L08CB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2887 bra L13CE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2888
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2889 * Call a shellsub module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2890 L1427 clra Type/language byte to wildcard:any will match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2891 ldx <u0004 Get ptr to module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2892 pshs u Preserve U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2893 os9 F$Link Attempt to link it in
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2894 puls u Restore U
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2895 lbcs L162B If we couldn't link, Exit with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2896 ldx <u0004 Get ptr to module name again
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2897 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2898 os9 F$UnLoad Unlink it
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2899 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2900 pshs a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2901 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2902 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2903 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2904 puls a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2905 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2906 lbcs L162B If we couldn't unlink exit with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2907 ldx <u0008 Get ptr to current group (param ptr for shellsub)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2908 ldd <u0006 Get size of param area for shellsub
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2909 leau >u08D2,u Point to shellsub variable area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2910 jsr ,y Execute shellsub module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2911 pshs b,a,cc Preserve error status & A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2912 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2913 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2914 std <u0010 ? (originally pointing to E3 if type $11 module)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2915 ldx <u0004 Get shellsub module ptr
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2916 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2917 os9 F$UnLoad Unlink it
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2918 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2919 pshs a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2920 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2921 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2922 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2923 puls a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2924 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2925 std <u0004 Clear shellsub module ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2926 inc <u005D Set flag that we should wait for module to exit?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2927 puls pc,u,y,x,d,cc restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2928
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2929 L1459 lda #C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2930 sta -1,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2931 L145D clr <u0060
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2932 pshs u,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2933 ldx <u0004 Get ptr to name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2934 ldd ,x Get 2 chars of name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2935 andb #$5F Force 2nd one to uppercase
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2936 cmpd #$2F57 Is it a /W?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2937 bne L1473 No, check for shellsub
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2938 comb Yes, exit with bad mode error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2939 ldb #E$BMode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2940 lbra L162B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2941
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2942 L1473 clra Wildcard NMLink
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2943 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2944 os9 F$NMLink Link to module
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2945 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2946 pshs u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2947 os9 F$Link Link to module
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2948 puls u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2949 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2950 lbcs L1329 Error, do something
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2951 cmpa #ShellSub+Objct ShellSub module?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2952 beq L1427 Yes, go set up for it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2953 ldx <u0004 Get ptr to name back
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2954 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2955 os9 F$UnLoad Drop the link count back down
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2956 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2957 pshs a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2958 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2959 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2960 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2961 puls a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
2962 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2963 pshs y Save data area size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2964 ldx <u0004 Get ptr to module name again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2965 leay >L000D,pc Point to 'Shell'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2966 ldb #$05 Size of 'Shell'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2967 os9 F$CmpNam Is the module requested Shell?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2968 puls y Restore data area size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2969 bcs L14A3 Not shell, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2970 ldb 5,x Get char right after 'shell'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2971 cmpb #C$CR Is 'shell' the only thing on the line?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2972 lbeq L158D Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2973 cmpb #C$SPAC Is it a space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2974 lbeq L158D Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2975 * Not Shell or Shellsub module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2976 L14A3 cmpa #Prgrm+Objct ML program?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2977 lbeq L15D7 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2978 cmpa #Data Is it a data module?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2979 bne L14D7 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2980 inc <u0060 Set flag - data module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2981 L14AF inc <u0060 Bump it up
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2982 ldx <u0004 Get ptr to module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2983 os9 F$PrsNam Parse the name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2984 ldy <u0063 Get ptr to Intercept routines data mem ($418)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2985 leay $0A,y Bump up to $422
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2986 sty <u0008 Save ptr to start of current group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2987 sty <u0061 ??? Ptr to data modules name?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2988 ldx #60 Max size of group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2989 stx <u0006 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2990 ldx <u0004 Get ptr to module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2991 L14C8 lda ,x+ Copy it to buffer @ $422
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2992 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2993 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2994 bne L14C8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2995 lda #C$CR Append a CR to it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2996 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2997 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2998 lbra L1564
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
2999 * Not 6809 object code or data module either
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3000 L14D7 sty <u000A Save data area size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3001 leax >L0013,pc Point to alternate languages table
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3002 L14DE tst ,x Is this entry active?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3003 lbeq L1629 No, exit with non-existing module error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3004 cmpa ,x+ Same module type as we want?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3005 beq L14EE Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3006 L14E8 tst ,x+ No, eat module name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3007 bpl L14E8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3008 bra L14DE Try next module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3009 * Found run-time language match
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3010 L14EE ldd <u0008 Get ptr to start of current command group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3011 subd <u0004 Calculate size of whole group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3012 addd <u0006 Don't include size of current group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3013 std <u0006 Save remainder size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3014 ldd <u0004 Get ptr to start of sub-module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3015 std <u0008 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3016 pshs y,x Preserve data area size & primary module ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3017 leax >L0021,pc Point to 'RUNB'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3018 cmpx ,s Is that the run-time module we want?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3019 bne L1546 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3020 * RUNB needed - have to () & quote/commas between params
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3021 ldx <u0008 Yes, get sub-module ptr?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3022 leay >u0418,u Point to before sub-module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3023 bsr L154B Copy buffer up to next param (or end of line)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3024 beq L1535 If it was end of line, add CR & continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3025 ldd ,x Get 2 param chars
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3026 cmpd #$2822 Is it '("' (RUNB variables ahead?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3027 beq L1546 Yes, skip ahead (we won't have to add them)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3028 lda #C$SPAC No, add ' ("'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3029 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3030 ldd #$2822
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3031 std ,y++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3032 L151F bsr L154B Copy buffer up to next param (or end of line)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3033 beq L152E If end of line, add '")' (close params)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3034 ldd #$222C Add '","' (Basic09 param separators
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3035 std ,y++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3036 lda #$22 2nd quote of above
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3037 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3038 bra L151F Keep doing for all parameters
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3039
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3040 L152E ldd #$2229 Add '")' to end parameter list
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3041 std ,y++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3042 lda #C$CR Add CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3043 L1535 sta ,y+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3044 tfr y,d Move end of param ptr to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3045 leay >u0418,u Point to start of param
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3046 sty <u0008 Save as start ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3047 subd <u0008 Calculate param size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3048 std <u0006 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3049 L1546 puls y,x Restore data area size & primary module ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3050 lbra L15D5
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3051
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3052 * Copy from X to Y until either a CR or a space char is hit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3053 * If it finds a space, it will eat them until the next non-space char is found
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3054 L154B lda ,x+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3055 cmpa #C$SPAC Is it a space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3056 * Was L155B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3057 beq L1559 yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3058 cmpa #C$CR Is it the end of the line?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3059 beq L155F Yes, bump ptr back to CR & exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3060 sta ,y+ Save the char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3061 bra L154B Keep doing it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3062
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3063 L1559 lda ,x+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3064 L155B cmpa #C$SPAC Is it another space?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3065 beq L1559 Yes, keep eating spaces
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3066 L155F leax -$01,x Bump ptr back to either non-space or CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3067 cmpa #C$CR Is it a CR? & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3068 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3069
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3070 * THIS CMPB / LBEQ SEEMS TO BE USELESS, AS B IS ALWAYS CLEAR COMING INTO THIS
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3071 * ROUTINE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3072 L1564 cmpb #E$BMode
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3073 lbeq L162B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3074 ldx <u0006 Get size of current group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3075 leax 5,x Bump it up by 5???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3076 stx <u0006 Save new size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3077 tst <u0060 Data module linked?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3078 bne L1592 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3079 ldx <u0004 Get module name ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3080 ldu 4,s
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3081 lbsr CmdIn Set up paths
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3082 lbcs L162B If error, exit with it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3083 bra L1592 Start up shell with '-P X PATH=(current)'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3084
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3085 * L1581 is for sub-shells (?), L1586 for normal shells
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3086 L1581 fcc '-P X ' Prompting off/exit on error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3087 L1586 fcc 'PATH= ' For inheriting parent shell's paths
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3088 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3089
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3090 L158D leax <L1586,pc Point to 'path='
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3091 bra L1595 Skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3092
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3093 L1592 leax <L1581,pc Point to '-p x '
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3094 L1595 leay >u166D,u Point to about-to-be merged buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3095 lbsr L1320 Copy up until CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3096 leay -1,y Point to CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3097 leax >u0CDD,u Point to copy of current path=
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3098 * Copy all paths to buffer, changing <CR> separated ones with Spaces
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3099 L15A2 lda ,x Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3100 cmpa #C$CR CR?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3101 beq L15B1 Yes, don't copy this buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3102 lbsr L1320 Copy up until CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3103 lda #C$SPAC Replace CR with Space
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3104 sta -1,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3105 bra L15A2 Continue copying CR marked blocks until done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3106 L15B1 lda #'; Replace final CR with ; (command separator)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3107 sta -1,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3108 tst <u0060
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3109 beq L15BE
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3110 ldd #'M*256+'= If flag set, append 'M='
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3111 std ,y++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3112 L15BE ldx <u0008 Get ptr to start of current group
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3113 lbsr L1320 Copy up until CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3114 leax >u166D,u Point to merged buffer again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3115 stx <u0008 Make it the new current group start
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3116 tfr y,d Move end buffer ptr to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3117 pshs x Push merged buffer ptr for SUBD
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3118 subd ,s++ Calculate size of merged buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3119 std <u0006 Save merged buffer size
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3120 leax >L000D,pc Point to 'shell'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3121
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3122 L15D5 stx <u0004 Save ptr to module name to fork
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3123 L15D7 ldx <u0004 Get ptr to module name to fork
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3124 lda #Prgrm+Objct
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3125 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3126 os9 F$NMLink Get memory requirement stuff from it
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3127 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3128 pshs u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3129 os9 F$Link Get memory requirement stuff from it
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3130 tfr u,y
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3131 puls u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3132 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3133 bcc L15E5 Got it, continue
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3134 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3135 os9 F$NMLoad Couldn't get, try loading it
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3136 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3137 pshs u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3138 os9 F$Load Couldn't get, try loading it
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3139 tfr u,y
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3140 puls u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3141 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3142 bcs L162B Still couldn't get, can't fork
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3143 L15E5
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3144 IFEQ Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3145 ldy M$Mem,y
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3146 ENDC
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3147 tst <u0003 Memory size specified?
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3148 bne L15F2 Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3149 tfr y,d No, tfr modules mem size to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3150 addd <u000A ??? Add to something
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3151 addd #$00FF Round up to nearest page
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3152 sta <u0003 Save # of pages need for data mem
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3153 L15F2 clr ,-s Clear byte on stack to store original priority
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3154 ldb <u0022 Get priority we want to set new program at
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3155 beq DnePrior 0=Use inherited priority, skip ahead
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3156 IFEQ Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3157 ldx <D.Proc
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3158 ELSE
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3159 leax >u166D,u Point to place to hold Process descriptor
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3160 os9 F$ID Get our process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3161 os9 F$GPrDsc Get our process descriptor
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3162 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3163 ldb P$Prior,x Get our priority
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3164 stb ,s Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3165 ldb <u0022 Get priority for new process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3166 os9 F$SPrior Set our priority so child will inherit it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3167 DnePrior lbsr L130A Go setup Fork entry registers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3168 os9 F$Fork Create the new process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3169 pshs d,cc Preserve error (if any) & new process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3170 ldb 3,s Get original priority back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3171 beq L1609 Priority didn't change, ignore it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3172 os9 F$ID Get our process # into A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3173 os9 F$SPrior Reset our priority back to normal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3174 L1609 lda #Prgrm+Objct Std 6809 module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3175 ldx <u0010 Get ptr to some other module name (?)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3176 bne L1611 There is one, unlink it instead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3177 ldx <u0004 Get ptr to command name
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3178 L1611
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3179 IFGT Level-1
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3180 os9 F$UnLoad Bump link count down back to normal?
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3181 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3182 pshs a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3183 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3184 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3185 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3186 puls a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3187 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3188 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3189 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3190 std <u0010 Zero out other module name ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3191 std <u0004 Clear out ptr to main command name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3192 lda <u0060 Check if data module needs to be unlinked too
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3193 cmpa #$01 Just 1 link to it?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3194 bne L1627 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3195 lda #Data Data module
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3196 ldx <u0061 Get ptr to name of data module
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3197 IFGT Level-1
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3198 os9 F$UnLoad Bump link count down back to normal
1505
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3199 ELSE
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3200 pshs a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3201 os9 F$Link
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3202 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3203 os9 F$Unlink
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3204 puls a,b,x,y,u
5d726c0e6238 shellplus back-ported to Level 1
boisy
parents: 1255
diff changeset
3205 ENDC
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3206 L1627 puls cc,d Get back F$FORK error/process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3207 leas 1,s Eat priority byte
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3208 puls pc,u,y,x Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3209
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3210 L1629 ldb #E$NEMod Non-existing module error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3211 L162B coma
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3212 puls pc,u,y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3213
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3214 L162E fcc '/pipe'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3215 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3216
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3217 CmdPIPE pshs x
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3218 leax <L162E,pc Point to '/pipe'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3219 ldd #$0103
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3220 lbsr L0C0E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3221 puls x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3222 bcs L169E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3223 lbsr L1459
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3224 bcs L169E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3225 lda ,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3226 bne L1653
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3227 os9 I$Dup
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3228 bcs L169E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3229 sta ,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3230 L1653 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3231 os9 I$Close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3232 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3233 os9 I$Dup
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3234 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3235 lbsr L0BA8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3236 lda #$02
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3237 lbra L0BA8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3238
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3239 * Filename for shell log-append mode because of leading '+'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3240 L1666 fcc '+/dd/log/uxxx'
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3241 fcb C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3242
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3243 * Make shell logging filename @ u0CBD,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3244 L1674 leax <L1666,pc Point to log name string (append mode)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3245 leay >u0CBD,u Point to buffer to hold shell log name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3246 lbsr L1320 Copy name to buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3247 leay -4,y Point to where 1st digit will go
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3248 lda <u005A+1 Get LSB of user #?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3249 pshs y,x,d Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3250 leay <L1693,pc Point to routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3251 bra L16B9 Go convert digits & append to logname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3252
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3253 L168A lda <u0047
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3254 pshs y,x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3255 leay <L1693,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3256 bra L16B9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3257
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3258 L1693 ldy $0B,s Get ptr to where shell log # goes
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3259 ldd $03,s Get 1st 2 digits of #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3260 std ,y++ Save in shell log pathname
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3261 lda $05,s Get last digit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3262 sta ,y Save it too
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3263 L169E rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3264
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3265 L169F ldd 4,s Get last 2 digits of process # (ASCII)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3266 std >u01EC,u Save it & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3267 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3268
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3269 L16A6 pshs y,x,d Preserve End of parm ctr & others
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3270 os9 F$ID Get user's ID #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3271 sty <u005A Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3272 leay <L169F,pc Point to routine
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3273 bra L16B9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3274
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3275 * Set up to write out process # when forked?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3276 L16B3 pshs y,x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3277 leay >L021B,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3278
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3279 * Entry: A=Process ID #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3280 * Exit: L01EC=2 lower digits of process # in ASCII format
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3281
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3282 L16B9 pshs y,x,b Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3283 leax 1,s Point X to X value on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3284 ldb #$2F Init B to start @ '0' in loop
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3285 L16BF incb Bump ASCII # up
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3286 suba #100 Start with 100's digit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3287 bhs L16BF More left, keep going
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3288 stb ,x+ Save digit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3289 ldb #$3A Init so loop starts @ ASCII '9'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3290 L16C8 decb Bump ASCII # down
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3291 adda #10 Do 10's digit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3292 bhs L16C8 Still more, keep going
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3293 stb ,x+ Save 10's digit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3294 adda #$30 Bump 1's digit up to ASCII equivalent
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3295 ldb #C$CR Add carriage return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3296 std ,x Save overtop Y on the stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3297 leax ,s Point X to B on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3298 jsr ,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3299 leas 5,s Eat stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3300 puls pc,y,x,d Restore other regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3301
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3302 * KILL command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3303 CmdKill bsr L16EB Go get process # to kill
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3304 cmpb #2 Trying to kill the system process or 1st shell?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3305 bls L170A Yes, print 'WHAT?' & ignore it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3306 tfr b,a Move process # to proper reg
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3307 L16E5 clrb S$Kill signal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3308 os9 F$Send Send it to the process & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3309 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3310
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3311 * Clear Screen by writing $0C to stdout
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3312 ClrByte fcb $0C
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3313 ClrLen equ *-ClrByte
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3314
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3315 CmdCLS
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3316 pshs x
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3317 lda #$01
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3318 leax ClrByte,pcr
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3319 ldy #ClrLen
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3320 os9 I$Write
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3321 puls x,pc
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3322
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3323 * Set priority - subroutine to calculate binary version of #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3324 * (used for both process # & priority values)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3325 L16EB clrb Initialize # for loop
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3326 L16EC lda ,x+ This loop will calculate the binary version
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3327 suba #$30 Of the ASCII # pointed to by X
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3328 cmpa #9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3329 bhi L16FD
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3330 pshs a
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3331 lda #10
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3332 mul
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3333 addb ,s+
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3334 bcc L16EC Keep going until overflows past 255
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3335 L16FD lda ,-x Get last char done
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3336 bcs L1708 If #>255, eat RTS & exit with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3337 tst <u0014 If flag is set, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3338 bne L169E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3339 tstb Otherwise, check if # is 0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3340 bne L169E No, return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3341 L1708 leas 2,s Yes, eat RTS address & exit with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3342 L170A lbra L0BCF Print 'WHAT?'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3343 * SETPR routine
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3344 CmdSETPR bsr L16EB Go calculate process #
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3345 stb <u0021 Save it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3346 lbsr L0907 Find next field (after commas/spaces)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3347 bsr L16EB Go calculate priority (into B)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3348 lda <u0021 Get process #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3349 os9 F$SPrior Set it's priority & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3350 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3351
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3352 L171C fcc 'pwd: bad name in path'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3353 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3354 L1732 fcc '.......................................'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3355 L1759 fcc '.'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3356 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3357 L175B fcc 'pwd: read error'
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3358 fcb C$CR
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3359
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3360 CmdPWD clr <u003D
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3361 L176D pshs y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3362 leay >u02F2,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3363 lda #$81
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3364 tst <u0037
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3365 beq L178F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3366 ldx <u0039
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3367 bra L17F7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3368 * .PXD command
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3369 CmdPXD clr <u003D
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3370 pshs y,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3371 leay >u0375,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3372 lda #$85
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3373 tst <u0038
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3374 beq L178F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3375 ldx <u003B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3376 bra L17F7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3377 L178F sta <u0029
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3378 sty <u003E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3379 L1794 leax >$0080,y
2817
5c6b71612ce4 Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2372
diff changeset
3380 lda #C$CR
714
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3381 sta ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3382 stx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3383 leax <L1759,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3384 stx <u0040
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3385 bsr L1801
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3386 lbsr L183C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3387 L17A9 ldd <u002C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3388 std <u0032
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3389 lda <u002E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3390 sta <u0034
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3391 bsr L1828
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3392 beq L17D3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3393 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3394 os9 I$Close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3395 lbcs L188C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3396 ldx <u0040
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3397 leax -$01,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3398 stx <u0040
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3399 bsr L1801
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3400 bsr L183C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3401 bsr L1817
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3402 leax >u03F8,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3403 lbsr L1859
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3404 bra L17A9
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3405 L17D3 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3406 ldb #SS.DevNm
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3407 leax >u00B5,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3408 os9 I$GetStt Get device name
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3409 bsr L1859
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3410 L17E0 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3411 os9 I$Close
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3412 ldx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3413 lda <u0029
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3414 bita #$04
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3415 bne L17F3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3416 inc <u0037
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3417 stx <u0039
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3418 bra L17F7
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3419 L17F3 inc <u0038
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3420 stx <u003B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3421 L17F7 ldy #$0083
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3422 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3423 clrb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3424 lbra L18A0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3425 L1801 lda <u0029
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3426 os9 I$Open
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3427 sta <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3428 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3429 L1809 lda <u0012
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3430 leax >u03F8,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3431 ldy #$0020
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3432 os9 I$Read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3433 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3434 L1817 bsr L1809
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3435 bcs L1896
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3436 leax >u0415,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3437 leay >u0032,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3438 bsr L1830
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3439 bne L1817
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3440 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3441 L1828 leax >u002C,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3442 leay >u002F,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3443 L1830 ldd ,x++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3444 cmpd ,y++
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3445 bne L183B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3446 lda ,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3447 cmpa ,y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3448 L183B rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3449 L183C bsr L1809
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3450 ldd >u0415,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3451 std <u002F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3452 lda >u0417,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3453 sta <u0031
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3454 bsr L1809
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3455 ldd >u0415,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3456 std <u002C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3457 lda >u0417,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3458 sta <u002E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3459 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3460 L1859 os9 F$PrsNam
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3461 bcs L1890
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3462 ldx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3463 pshs b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3464 incb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3465 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3466 std <u0032
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3467 tfr x,d
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3468 subd <u0032
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3469 cmpd <u003E
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3470 bls L1881
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3471 puls b
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3472 L1871 lda ,-y
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3473 anda #$7F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3474 sta ,-x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3475 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3476 bne L1871
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3477 lda #$2F
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3478 sta ,-x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3479 stx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3480 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3481
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3482 L1881 lda #'*
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3483 sta ,-x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3484 stx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3485 leas 3,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3486 lbra L17E0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3487
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3488 L188C pshs b,cc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3489 bra L18AB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3490
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3491 L1890 leax >L171C,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3492 bra L189A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3493
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3494 L1896 leax >L175B,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3495 L189A leas $02,s
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3496 ldd #$02FF
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3497 L18A0 stx <u002A
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3498 pshs b,cc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3499 tst <u003D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3500 bne L18AB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3501 os9 I$WritLn
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3502 L18AB puls b,cc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3503 puls y,x,pc
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3504
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3505 L18DB leax >u0124,u Point to PD.OPT work copy area
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3506 clrb Change to CLRB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3507 os9 I$GetStt Get current PD.OPT settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3508 tst ,x Check device type
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3509 bne L1914 If not SCF, don't bother changing stuff
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3510 inc >u1812,u Set flag that we are changing key defs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3511 ldd <$10,x Get PD.INT & PD.QUT chars (<CTRL>-<C> & <E>)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3512 sta >u180F,u Save copy of PD.INT
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3513 stb >u180E,u Save copy of PD.QUT
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3514 ldd #$0A0C Reload with up & down arrows
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3515 std <$10,x Save 'em
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3516 lda $06,x Get PD.NUL count (normally 0)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3517 sta >u1811,u Save copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3518 lda #$05 Replace with 5
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3519 sta $06,x
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3520 clra
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3521 clrb Reset path options to new settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3522 os9 I$SetStt Do SS.OPT Setstat
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3523
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3524 * Non-SCF devices go here (ex. a script file would be RBF)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3525 L1914 ldb #SS.SSig Send signal on data ready
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3526 ldx #$000B Signal code to send is $B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3527 rts Do SetStt, clear <E signal copy, and go to L191C
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3528
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3529 * X still is $B from L1914
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3530 * Called when F$Sleep @ L0171 is interrupted by keyboard/mouse signal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3531 L191C ldb <u000E Get Signal code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3532 clr <u000E Clear memory copy of signal code
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3533 cmpb #S$Abort Keyboard abort signal (<CTRL>-<E>)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3534 bne L1928 No, check next
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3535 bsr L1932 Write CR out if no history yet
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3536 bra L1967 Go backwards in history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3537
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3538 L1928 cmpb #S$Intrpt Keyboard interrupt signal (<CTRL>-<C>)?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3539 lbne L017B No check for $B signal (ignore rest)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3540 bsr L1932 Write CR out if no history yet
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3541 bra L1991 Go forwards in history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3542
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3543 * Keyboard abort or Keyboard interrupt signal
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3544 L1932 tst >u180D,u Any history entries yet?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3545 bne L193D Yes, exit
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3546 bsr L1959 Otherwise, put CR into the buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3547 os9 I$WritLn Write it out to standard out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3548 L193D rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3549
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3550 L193E os9 I$ReadLn Read in line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3551 bcc L194E No error, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3552 * NOTE: WHEN THE ABORT A SUB-FORKED PROGRAM BUG OCCURS, THE ABOVE READLN
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3553 * EXITS WITH CARRY SET & B=0 (ERROR 0)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3554 cmpb #$02 Go backward in history buffer signal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3555 beq L1967 Yes, go process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3556 cmpb #$03 Go forward in history buffer signal?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3557 beq L1991 Yes, go process
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3558 lbra L1AAA Go to parse routine with unknown error in B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3559 L194E cmpy #$0001 Just 1 char. read?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3560 lbeq L1AA3 Yes, go do normal parsing (no error)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3561 lbra L1A37 Otherwise, change chars <$0D to spaces
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3562
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3563 * Change A to be standard output???
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3564 L1959 lda #C$CR Carriage return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3565 leax >u0124,u ??? Point to a buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3566 sta ,x Save CR there
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3567 clra Prepare to write the CR out to standard input
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3568 ldy #$0001
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3569 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3570 * PD.QUT (redefined to be go back 1 in history buffer)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3571 L1967 tst >u180C,u Any lines in history buffer?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3572 bne L1972 Yes, go move between them
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3573 bsr L1959 Otherwise, put CR into buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3574 lbra L1AA3 Go to normal command parse routine (no error)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3575
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3576 L1972 ldb >u180D,u Get 'current' history buffer entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3577 cmpb #$01 On the first one?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3578 bls L1987 Yes, go wrap to end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3579 cmpb >u180C,u Somehow point past last one?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3580 bhi L1987 Yes, bump back to last one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3581 decb Bump to previous one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3582 stb >u180D,u Save it as 'current' history entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3583 bra L19B3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3584
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3585 L1987 ldb >u180C,u Get highest history entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3586 stb >u180D,u Make it the current
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3587 bra L19B3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3588
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3589 * PD.INT (redefined to be go forward 1 in history buffer)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3590 L1991 tst >u180C,u Any lines in history buffer?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3591 bne L199C Yes, go move between them
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3592 bsr L1959 Otherwise, put CR into buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3593 lbra L1AA3 Go to normal command parse routine (no error)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3594
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3595 L199C ldb >u180D,u Get current history entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3596 cmpb >u180C,u Higher or same as last one?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3597 bhs L19AD Yes, wrap to beginning
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3598 incb Bump to next one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3599 stb >u180D,u Save it as 'current' history entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3600 bra L19B3
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3601
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3602 L19AD ldb #$01 Set history entry # to 1st one
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3603 stb >u180D,u Save as 'current' entry #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3604 L19B3 bsr L19D3 Go get ptr to history entry buffer we want
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3605 sty >u1813,u Save 'current' history buffer ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3606 leax >u0213,u Point to expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3607 ldy >u01F7,u Get size of expanded shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3608 lda #$02 Std Err
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3609 os9 I$WritLn Write out shell prompt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3610 bsr L19EA Go Pre-load Read buffer with history entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3611 bcc L1A0E No error, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3612 lbra L1AAA Normal parse with error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3613
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3614 * Find history entry # we want
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3615 * Entry: B=history entry # (1-xx)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3616 * Exit: Y=Ptr to history buffer entry we wanted
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3617 L19D3 ldy >u180A,u Get ptr to start of history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3618 L19D8 decb Bump down counter to find entry we want
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3619 beq L19E9 Found it, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3620 L19DB tst ,y+ Wrong one, search for end of one we are checking
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3621 beq L19E4 Found it, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3622 lbsr L1A97 Wrap buffer ptr if we hit end of all history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3623 bra L19DB Keep searching for end of current entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3624
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3625 L19E4 lbsr L1A97 Wrap buffer ptr if we hit end of all history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3626 bra L19D8 Go into next entry in history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3627
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3628 L19E9 rts Found it, leave
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3629
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3630 L19EA leax >u0124,u Point to temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3631 ldy >u1813,u Get ptr to current history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3632 clrb Set counter to 0 (size of buffer)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3633 L19F4 lda ,y+ Get char from history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3634 beq L1A00 Found end, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3635 sta ,x+ Put it in temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3636 incb Bump up size counter
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3637 lbsr L1A97 Wrap buffer ptr if we hit end of all history
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3638 bra L19F4 Continue copying into temp buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3639 L1A00 clra D=Size of history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3640 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3641 tfr d,y Move to proper register
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3642 leax >u0124,u Point to buffer history copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3643 ldb #SS.Fill Fill it with current selected history command
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3644 os9 I$SetStt
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3645 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3646
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3647 * Successfull SS.Fill of history buffer goes here
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3648 L1A0E lda #$01 Write copy of history buffer to std out
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3649 os9 I$Write
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3650 leax >u0124,u Point to current history buffer again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3651 tfr y,d Transfer # bytes written to D
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3652 lda #C$BSP Backspace char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3653 L1A1B sta ,x+ Fill buffer with backspaces
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3654 decb
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3655 bne L1A1B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3656 leax >u0124,u Write them to reset cursor to start of line
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3657 lda #$01
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3658 os9 I$Write
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3659 ldd #SS.Relea Eat keyboard signal (SS.Fill cleared it out of
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3660 os9 I$SetStt the read buffer already)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3661 ldb #SS.SSig Setup for re-enabling it
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3662 ldx #$000B Signal Code to send on keypress=$B
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3663 lbra L016A Go re-enable signal send on keyboard/mouse input
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3664
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3665 * Put new entry into history buffers, adjusting # used, etc.)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3666 * Entry: Y=# bytes read in ReadLn <>1
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3667 L1A37 pshs y Preserve # bytes read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3668 tfr y,d Move to D reg
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3669 ldy >u1808,u Get ptr to where next history entry will go
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3670 leax >u0124,u Point to line entered by user
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3671 L1A44 lda ,x+ Get char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3672 cmpa #C$CR Control char <$0d?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3673 bhs L1A4C No, save the character
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3674 lda #C$SPAC Replace with space char if it is
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3675 L1A4C sta ,y+ Save char into history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3676 bsr L1A97 Wrap to beginning if we hit end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3677 cmpy >u180A,u Point to entry #1?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3678 bne L1A59 No, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3679 bsr L1A7B Yes, make new #1 entry & drop # of entries
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3680 L1A59 decb Drop # bytes left in new entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3681 bne L1A44 Not done, continue
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3682 clr ,y+ mark end with NUL
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3683 bsr L1A97 Wrap to beginning if at end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3684 cmpy >u180A,u Pointing to entry #1?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3685 bne L1A69 No, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3686 bsr L1A7B Yes, make new #1 entry & drop # of entries
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3687 L1A69 inc >u180C,u Increase # of entries
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3688 sty >u1808,u Save ptr to where next history entry will go
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3689 puls y Restore # bytes read
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3690 clra Point to temp buffer again
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3691 leax >u0124,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3692 bra L1AA3 Normal parse, no error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3693
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3694 * Reset ptr to new 1st entry in history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3695 L1A7B pshs y Preserve current location in history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3696 ldy >u180A,u Point to start of 1st entry
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3697 L1A82 tst ,y+ End of current entry?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3698 beq L1A8A Yes, skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3699 bsr L1A97 No, wrap if we need to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3700 bra L1A82 Keep going until we find end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3701 L1A8A bsr L1A97 Wrap if we need to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3702 dec >u180C,u Dec # lines in history buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3703 sty >u180A,u Save new 'start of history' ptr
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3704 puls pc,y Restore current location & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3705 * If we are at end of history buffers, wrap to beginning (raw, has nothing to
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3706 * do with entry #'s)
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3707 L1A97 cmpy >u1806,u Are we at end of buffer for history entries?
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3708 bne L1AA2 No, continue on
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3709 leay >u1815,u Yes, reset to beginning of history buffers
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3710 L1AA2 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3711
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3712 L1AA3 bsr L1AB1 Reset std paths to normal <CTRL>-<E>/<C> settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3713 andcc #^Carry No error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3714 lbra L018B Normal command processing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3715
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3716 L1AAA bsr L1AB1 Reset std paths to normal <CTRL>-<E>/<C> settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3717 orcc #Carry Error
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3718 lbra L018B Normal command processing
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3719
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3720 * Reset all 3 standard paths' NUL counts/Keyboard Interrupt/Terminate settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3721 L1AB1 pshs x,d Preserve regs
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3722 tst >u1812,u Check flag
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3723 beq L1AD6 If 0 skip ahead
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3724 leas <-PD.OPT,s Make 32 byte buffer on stack
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3725 leax ,s Point X to buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3726 clrb CHANGE TO CLRB
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3727 clra Standard input path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3728 bsr L1AD8 Restore NUL counts, Keyboard Intrpt/Terminate
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3729 lda #$01 Do same for Standard output path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3730 bsr L1AD8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3731 lda #$02 Do same for Standard Error path
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3732 bsr L1AD8
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3733 leas <PD.OPT,s Eat stack buffer
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3734 clr >u1812,u Reset PD.OPT flags to 0
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3735 clr >u180D,u
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3736 L1AD6 puls pc,x,d Restore regs & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3737
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3738 * Restore path options to preserved Keyboard terminate/interrupt & end of
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3739 * line NUL counts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3740 L1AD8 pshs a Preserve path #
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3741 os9 I$GetStt Get current PD.OPT settings
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3742 lda >u180E,u Get copy of Keyboard terminate char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3743 sta <PD.QUT-PD.OPT,x Save into buffered copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3744 lda >u180F,u Get copy of Keyboard interrupt char
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3745 sta <PD.INT-PD.OPT,x Save into buffered copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3746 lda >u1811,u Get copy of end of line NUL count
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3747 sta $6,x Save into buffered copy
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3748 puls a Get path # back
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3749 os9 I$SetStt Reset path options with restored values & return
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3750 rts
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3751
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3752 emod
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3753 eom equ *
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3754 end
2e5433122a67 Fixed line ending problem
boisy
parents: 510
diff changeset
3755