annotate level1/cmds/shellplus.asm @ 2870:91d0226c431a

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