Subversion Repositories MB01 Project

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
  Thu Mar 24 11:31:55 2016                                                                                               Page    1
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
          2500 A.D. 65816 Macro Assembler #26960 - Version 5.02g
10
          -----------------------------------------------------
11
 
12
                       Input  Filename : src\FA\lib1.asm
13
                       Output Filename : obj\FA\lib1.obj
14
                       Listing Has Been Relocated
15
 
16
 
17
 2172                        	.LIST		on
18
 2173
19
 2174  F8FF66                		.INCLUDE inc\dirp00.inc
20
 2175                        	;----------------------------------------------------------
21
 2176                        	; DIRP00.ASM
22
 2177                        	; PROGETTO: B1601
23
 2178                        	;
24
 2179                        	; Variabili in Direct Page $00
25
 2180                        	;----------------------------------------------------------
26
 2181
27
 2182                        	; sezione COMMON -- questo permette di includere il file in piu' file
28
 2183
29
 2184                        	.LIST on
30
 2185
31
 2186                        	DIRP00:	.SECTION page0, ref_only, common	;Direct-Page 00
32
 2187
33
 2188  000000                		.ABSOLUTE		;; inizia sempre da $00
34
 2189  000000                		.ORG		0x00
35
 2190  000000
36
 2191  000000  0000          	JiffyClk	.DW			; contatore 10ms 32 bit
37
 2192  000002  0000          			.DW
38
 2193  000004                	SysTmr		.DS	SYSTMRCNT	; system timer 0 (10ms)
39
 2194  000008                	SysTMF		.DS	SYSTMRCNT	; flag timer (80 -> start)
40
 2195  00000C  00            	Bnk0Flag	.DB			; <7>: flag test RAM banco 0 ok
41
 2196                        						; <6>: flag warm reset
42
 2197  00000D  00            	RTCFlag		.DB
43
 2198
44
 2199  00000E                	atadev		.DS	2	; flag device on ata bus #0 & #1
45
 2200                        					; <7>: device ready
46
 2201                        					; <6>: compact flash device (C.F.)
47
 2202                        					; <5>: device identification ok
48
 2203                        					; <4>: MBR loaded
49
 2204                        					; <3>: valid signature in MBR
50
 2205                        					; <2>: first partition found&active
51
 2206                        					; <1>:
52
 2207                        					; <0>: valid partition flag
53
 2208
54
 2209  000010                	atasec		.DS	8	; max. user sectors on ata device
55
 2210  000018                	atambr		.DS	8	; data for first partition found in mbr
56
 2211                        					; first 3 bytes for start sector of partition
57
 2212                        					; last byte for partition type
58
 2213  000020                	ataprt		.DS	8	; total sec's of first partition
59
 2214
60
 2215  000028  00            	fdcdrv		.DB		; phisycal drive status (drive #0)
61
 2216                        					; <7>: disk format established in bit 0&1
62
 2217                        					; <6>: double step seek done
63
  Thu Mar 24 11:31:55 2016                                                                                               Page    2
64
 
65
 
66
 
67
 
68
 2218                        					; <5>: trust format bit's (set after ok r/w)
69
 2219                        					; <4>: write protect bit (if disk in drive)
70
 2220                        					; <3>: don't care
71
 2221                        					; <2>: don't care
72
 2222                        					; <1>: HD disk if set else DD disk
73
 2223                        					; <0>: CBM format if set else IBM format
74
 2224
75
 2225  000029  00            	vdrive		.DB		; virtual drive status (ram disk, drive #1)
76
 2226                        					; <7>: disk format established in bit 0&1
77
 2227                        					; <6>: change disk simulation (after format)
78
 2228                        					; <5>: don't care
79
 2229                        					; <4>: write protect bit (under sw control)
80
 2230                        					; <3>: don't care
81
 2231                        					; <2>: don't care
82
 2232                        					; <1>: HD disk if set else DD disk
83
 2233                        					; <0>: CBM format if set else IBM format
84
 2234
85
 2235  00002A  00            	fdcctl		.DB		; fdc controller status
86
 2236                        					; <7>: drive is attached
87
 2237                        					; <6>: drive need recalibration (restore)
88
 2238                        					; <5>: FDC controller ok
89
 2239                        					; <4>: motor on
90
 2240                        					; <3>: dma is active
91
 2241                        					; <2>: dma chip ok (post routine)
92
 2242                        					; <1>: clock rate (1=HD,0=DD)
93
 2243                        					; <0>: disk ready
94
 2244
95
 2245  00002B  00            	fdctrk		.DB		; fd: current seek track
96
 2246  00002C  00            	fdcerr		.DB		; fd: last error code
97
 2247  00002D  00            	ataerr		.DB		; ata: last error code
98
 2248  00002E  00            	ataxer		.DB		; ata: last extended error code
99
 2249
100
 2250  00002F  00            	CtrlBrk		.DB		; flag CTRL+BREAK (NMI)
101
 2251
102
 2252  000030  0000          	MemTop		.DW		; top memoria RAM
103
 2253  000032  00            			.DB		; banco top mem
104
 2254
105
 2255  000033  00            	DflTxtIn	.DB		; device di default text input
106
 2256  000034  00            	DflTxtOut	.DB		; device di default text output
107
 2257
108
 2258  000035                	COPPtr		LP		; long pointer for COP decoding
109
 2259  000038  00            	COPIdx		.DB		; COP signature/index
110
 2260
111
 2261                        	; variabili utilizzate da ACIA
112
 2262  000039  00            	ACIAFlag	.DB
113
 2263
114
 2264  00003A  00            	ACIArxe_1	.DB		; flag errore	7: errore RX (scarta dato)
115
 2265                        					;		6: overflow buffer RX
116
 2266                        					;		5: disconnessione remota
117
 2267                        					;		2: framing error
118
 2268                        					;		1: parity error
119
 2269                        					;		0: overrun error
120
 2270  00003B  00            	ACIArxe_2	.DB
121
 2271
122
 2272  00003C  00            	ACIAhsk_1	.DB		; handshake	7: handshake attivo
123
 2273                        					;		6: handshake hardware (RTS,CTS)
124
 2274  00003D  00            	ACIAhsk_2	.DB
125
  Thu Mar 24 11:31:55 2016                                                                                               Page    3
126
 
127
 
128
 
129
 
130
 2275
131
 2276  00003E  00            	ACIAPause_1	.DB		; flag pausa	7: pausa remota (XOFF/RTS=1)
132
 2277                        					;		6: pausa locale (XON/CTS=1)
133
 2278  00003F  00            	ACIAPause_2	.DB
134
 2279
135
 2280  000040  00            	ACIAdsrt_1	.DB		; status transizioni DSR, CTS, DCD
136
 2281                        					; 7: DSRT, 6: CTST, 5: DCDT
137
 2282  000041  00            	ACIAdsrt_2	.DB
138
 2283
139
 2284  000042  00            	ACIAdsrl_1	.DB		; status livello linee DSR, CTS, DCD, DTR, RTS
140
 2285                        					; 7: DSRLVL, 6: CTSLVL, 5: DCDLVL
141
 2286                        					; 1:DTRLVL, 0:RTSLVL
142
 2287  000043  00            	ACIAdsrl_2	.DB
143
 2288
144
 2289  000044  00            	ACIArem_1	.DB		; byte OR registro formato per pausa remota
145
 2290  000045  00            	ACIArem_2	.DB
146
 2291
147
 2292  000046  00            	ACIAmsk_1	.DB		; maschera AND per test disconnessione
148
 2293                        					; $80 per test DSR - $20 per test DCD
149
 2294  000047  00            	ACIAmsk_2	.DB
150
 2295
151
 2296  000048  00            	ACIAcsr_1	.DB		; control status durante IRQ
152
 2297  000049  00            	ACIAcsr_2	.DB
153
 2298  00004A  00            	ACIAfr_1	.DB		; copia registro di formato
154
 2299  00004B  00            	ACIAfr_2	.DB
155
 2300  00004C  00            	ACIAOut_1	.DB		; trasmissione XON/XOFF
156
 2301  00004D  00            	ACIAOut_2	.DB
157
 2302
158
 2303  00004E  0000          	ACIAICnt_1	.DW		; numero bytes in coda RX 1
159
 2304  000050  0000          	ACIAIHead_1	.DW		; puntatore testa buffer RX 1
160
 2305  000052  0000          	ACIAITail_1	.DW		; puntatore coda buffer RX 1
161
 2306  000054  0000          	ACIAOCnt_1	.DW		; numero bytes in coda TX 1
162
 2307  000056  0000          	ACIAOHead_1	.DW		; puntatore testa buffer TX 1
163
 2308  000058  0000          	ACIAOTail_1	.DW		; puntatore coda buffer TX 1
164
 2309
165
 2310  00005A  0000          	ACIAICnt_2	.DW		; numero bytes in coda RX 2
166
 2311  00005C  0000          	ACIAIHead_2	.DW		; puntatore testa buffer RX 2
167
 2312  00005E  0000          	ACIAITail_2	.DW		; puntatore coda buffer RX 2
168
 2313  000060  0000          	ACIAOCnt_2	.DW		; numero bytes in coda TX 2
169
 2314  000062  0000          	ACIAOHead_2	.DW		; puntatore testa buffer TX 2
170
 2315  000064  0000          	ACIAOTail_2	.DW		; puntatore coda buffer TX 2
171
 2316
172
 2317                        	; bios mem
173
 2318  000066  0000          	nsize		.DW	; dimensione blocco da allocare
174
 2319                        	;bsize		.DW	; dimensione vera blocco free
175
 2320  000068  0000          	splitsz		.DW	; dimensione blocco splittato
176
 2321  00006A  0000          	bfree		.DW	; puntatore blocco free
177
 2322  00006C  0000          	hdrptr		.DW	; puntatore header heap
178
 2323
179
 2324  00006E  0000          	pbrklv		.DW	; current break level of current process
180
 2325  000070  0000          	pbrkmin		.DW	; minimum breal level of current process
181
 2326  000072  0000          	pbrkmax		.DW	; maximum breal level of current process
182
 2327
183
 2328  000074  00            	ACIATmp		.DB
184
 2329  000075  00            			.DB
185
 2330  000076
186
 2331                        	; bios temp. work area
187
  Thu Mar 24 11:31:55 2016                                                                                               Page    4
188
 
189
 
190
 
191
 
192
 2332  000076                	bwrktmp		.DS	$28
193
 2333
194
 2334  00009E  00            	BiosEnt		.DB		; flag accesso a bios setup
195
 2335
196
 2336  00009F  00            			.DB		; dummy
197
 2337  0000A0
198
 2338
199
 2339  00009F                		.RELATIVE
200
 2340
201
 2341                        		.ENDS
202
 2342
203
 2346                        	.LIST on
204
 2347
205
 2348                        	; page 0 local var's (declared in bios temp. work area)
206
 2349                        	_P0BTMP:	.SECTION page0, ref_only, offset bwrktmp	; DP Tmp. BIOS
207
 2350
208
 2351  000076                	cmdlin		LP		; long pointer to command line
209
 2352  000079                	optstr		LP		; long pointer to options mask
210
 2353  00007C  0000 0000     	dwres		.LWORD		; result
211
 2354  000080  00            	slen		.DB		; string length
212
 2355  000081  00            	squot		.DB		; flag quotation marks
213
 2356  000082  00            	cmdy		.DB		; index
214
 2357  000083  00            	chopt		.DB		; option char
215
 2358  000084  00            	prsfg		.DB		; parsing flag
216
 2359  000085  00            	opttyp		.DB		; option type
217
 2360
218
 2361                        		.ENDS
219
 2362
220
 2363                        	;---------------------------------------------------------------------------
221
 2364                        	; code segment -- bank $FA
222
 2365                        	;---------------------------------------------------------------------------
223
 2366
224
 2367                        		.CODEFA
225
 2368
226
 2369                        		.LONGA	off
227
 2370                        		.LONGI	off
228
 2371
229
 2372                        	; getopt
230
 2373                        	;
231
 2374                        	; param's:
232
 2375                        	;
233
 2376                        	;		sFlag	= <7>: show error message
234
 2377                        	;			  <6>: accept decimal numeric arguments
235
 2378                        	;			  <0>: called from monitor
236
 2379                        	;		sCmd	= long pointer to command line
237
 2380                        	;		sOpt	= long pointer to option's string
238
 2381                        	;		sRes	= 32 bit result
239
 2382                        	;
240
 2383                        	; param's stack offset
241
 2384          000006        	sRes	.SET	6
242
 2385          00000A        	sOpt	.SET	10
243
 2386          00000D        	sCmd	.SET	13
244
 2387          000010        	sFlag	.SET	16
245
 2388
246
 2389  FA0003                	_getopt:
247
 2390                        		.PUBLIC _getopt
248
 2391  FA0003  0B            		phd
249
  Thu Mar 24 11:31:55 2016                                                                                               Page    5
250
 
251
 
252
 
253
 
254
 2392  FA0004  F4 00 00      		pea	#0
255
 2393  FA0007  2B            		pld
256
 2394  FA0008                		ACC16			; move param's in local var's
257
 2395  FA0008  C2 20         		rep	#PMFLAG
258
 2396                        		.LONGA	on
259
 2397                        		.MNLIST
260
 2398  FA000A  A3 0A         		lda	sOpt,s
261
 2399  FA000C  85 79         		sta	optstr
262
 2400  FA000E  A3 0D         		lda	sCmd,s
263
 2401  FA0010  85 76         		sta	cmdlin
264
 2402  FA0012                		ACC08
265
 2403  FA0012  E2 20         		sep	#PMFLAG
266
 2404                        		.LONGA	off
267
 2405                        		.MNLIST
268
 2406  FA0014  A3 0C         		lda	sOpt+2,s
269
 2407  FA0016  85 7B         		sta	optstr+2
270
 2408  FA0018  A3 0F         		lda	sCmd+2,s
271
 2409  FA001A  85 78         		sta	cmdlin+2
272
 2410  FA001C  A3 10         		lda	sFlag,s
273
 2411  FA001E  85 84         		sta	prsfg
274
 2412  FA0020  A0 00         		ldy	#0
275
 2413  FA0022  84 85         		sty	opttyp
276
 2414  FA0024  20 97 00      		jsr	?104		; get next char
277
 2415  FA0027  F0 6B         		beq	?95		; return A=0
278
 2416  FA0029  C9 2D         		cmp	#'-'		; option?
279
 2417  FA002B  F0 0B         		beq	?05		; yes
280
 2418  FA002D  20 A0 00      		jsr	?110		; find end of argument
281
 2419  FA0030  B0 62         		bcs	?95		; error
282
 2420  FA0032  A9 80         		lda	#$80		; no option argument
283
 2421  FA0034  85 83         		sta	chopt
284
 2422  FA0036  80 43         		bra	?90
285
 2423  FA0038  20 4B 01      	?05:	jsr	?130		; check option
286
 2424  FA003B  B0 57         		bcs	?95		; error
287
 2425  FA003D  20 B6 01      		jsr	?140		; test option argument
288
 2426  FA0040  B0 52         		bcs	?95		; error
289
 2427  FA0042  A6 85         		ldx	opttyp
290
 2428  FA0044  E0 20         		cpx	#' '		; option without argument?
291
 2429  FA0046  F0 33         		beq	?90		; yes...so exit
292
 2430  FA0048  E0 3A         		cpx	#':'		; option requires a simple string argument?
293
 2431  FA004A  F0 2F         		beq	?90		; yes...so exit
294
 2432  FA004C  E0 24         		cpx	#'$'		; option requires up case string argument?
295
 2433  FA004E  F0 08         		beq	?10		; yes
296
 2434  FA0050  E0 21         		cpx	#'!'		; option requires a single char argument?
297
 2435  FA0052  F0 1D         		beq	?30		; yes
298
 2436  FA0054  E0 5E         		cpx	#'^'		; option requires a single up case char arg.?
299
 2437  FA0056  D0 1E         		bne	?40		; no
300
 2438  FA0058  A0 00         	?10:	ldy	#0
301
 2439  FA005A  B7 7C         	?15:	lda	[dwres],y	; up case string
302
 2440  FA005C  F0 0F         		beq	?25		; end of string
303
 2441  FA005E  C9 61         		cmp	#'a'
304
 2442  FA0060  90 08         		bcc	?20
305
 2443  FA0062  C9 7B         		cmp	#'z'+1
306
 2444  FA0064  B0 04         		bcs	?20
307
 2445  FA0066  29 DF         		and	#$DF
308
 2446  FA0068  97 7C         		sta	[dwres],y
309
 2447  FA006A  C8            	?20:	iny
310
 2448  FA006B  80 ED         		bra	?15
311
  Thu Mar 24 11:31:55 2016                                                                                               Page    6
312
 
313
 
314
 
315
 
316
 2449  FA006D  E0 24         	?25:	cpx	#'$'		; if requires string exit
317
 2450  FA006F  F0 0A         		beq	?90
318
 2451  FA0071  20 44 02      	?30:	jsr	?150		; check single char argument
319
 2452  FA0074  B0 1E         		bcs	?95		; error
320
 2453  FA0076  20 9F 02      	?40:	jsr	?160		; others option type
321
 2454  FA0079  B0 19         		bcs	?95
322
 2455  FA007B                	?90:	ACC16			; return to the caller result...
323
 2456  FA007B  C2 20         		rep	#PMFLAG
324
 2457                        		.LONGA	on
325
 2458                        		.MNLIST
326
 2459  FA007D  A5 76         		lda	cmdlin		; ...and residual command line string
327
 2460  FA007F  83 0D         		sta	sCmd,s
328
 2461  FA0081  A5 7C         		lda	dwres
329
 2462  FA0083  83 06         		sta	sRes,s
330
 2463  FA0085  A5 7E         		lda	dwres+2
331
 2464  FA0087  83 08         		sta	sRes+2,s
332
 2465  FA0089                		ACC08
333
 2466  FA0089  E2 20         		sep	#PMFLAG
334
 2467                        		.LONGA	off
335
 2468                        		.MNLIST
336
 2469  FA008B  A5 78         		lda	cmdlin+2
337
 2470  FA008D  83 0F         		sta	sCmd+2,s
338
 2471  FA008F  A4 85         		ldy	opttyp		; return Y=option type
339
 2472  FA0091  A5 83         		lda	chopt		; return A=option char
340
 2473  FA0093  18            		clc			; no error
341
 2474  FA0094  2B            	?95:	pld
342
 2475  FA0095  6B            		rtl
343
 2476
344
 2477  FA0096  C8            	?100:	iny			; get char from command line
345
 2478  FA0097  B7 76         	?104:	lda	[cmdlin],y
346
 2479  FA0099  F0 04         		beq	?106
347
 2480  FA009B  C9 20         		cmp	#' '
348
 2481  FA009D  F0 F7         		beq	?100
349
 2482  FA009F  60            	?106:	rts
350
 2483
351
 2484  FA00A0  A2 20         	?110:	ldx	#' '
352
 2485  FA00A2  86 81         		stx	squot		; normal end of string char
353
 2486  FA00A4  64 80         		stz	slen		; size of argument
354
 2487  FA00A6  C9 22         		cmp	#'"'		; search end of string
355
 2488  FA00A8  D0 03         		bne	?112		; not quoted
356
 2489  FA00AA  85 81         		sta	squot		; quoted string
357
 2490  FA00AC  C8            		iny
358
 2491  FA00AD  84 82         	?112:	sty	cmdy		; save index
359
 2492  FA00AF  B7 76         	?114:	lda	[cmdlin],y
360
 2493  FA00B1  D0 08         		bne	?115
361
 2494  FA00B3  A6 81         		ldx	squot
362
 2495  FA00B5  E0 22         		cpx	#'"'
363
 2496  FA00B7  F0 37         		beq	?122		; missing final quote
364
 2497  FA00B9  80 0E         		bra	?117
365
 2498  FA00BB  C5 81         	?115:	cmp	squot		; first blank/quote is end of string
366
 2499  FA00BD  F0 05         		beq	?116
367
 2500  FA00BF  E6 80         		inc	slen
368
 2501  FA00C1  C8            		iny
369
 2502  FA00C2  80 EB         		bra	?114
370
 2503  FA00C4  A9 00         	?116:	lda	#0		; put string terminator
371
 2504  FA00C6  97 76         		sta	[cmdlin],y
372
 2505  FA00C8  C8            		iny			; next token in command line
373
  Thu Mar 24 11:31:55 2016                                                                                               Page    7
374
 
375
 
376
 
377
 
378
 2506  FA00C9  A6 80         	?117:	ldx	slen		; check string length
379
 2507  FA00CB  F0 53         		beq	?126		; error
380
 2508  FA00CD  A6 82         		ldx	cmdy
381
 2509  FA00CF                		ACC16CLC
382
 2510  FA00CF  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
383
 2511                        		.LONGA	on
384
 2512                        		.MNLIST
385
 2513  FA00D1  8A            		txa
386
 2514  FA00D2  65 76         		adc	cmdlin
387
 2515  FA00D4  85 7C         		sta	dwres		; pointer to argument
388
 2516  FA00D6                		ACC08
389
 2517  FA00D6  E2 20         		sep	#PMFLAG
390
 2518                        		.LONGA	off
391
 2519                        		.MNLIST
392
 2520  FA00D8  A5 78         		lda	cmdlin+2
393
 2521  FA00DA  90 01         		bcc	?118
394
 2522  FA00DC  1A            		inc	a
395
 2523  FA00DD  85 7E         	?118:	sta	dwres+2
396
 2524  FA00DF  64 7F         		stz	dwres+3
397
 2525  FA00E1                	?119:	ACC16CLC
398
 2526  FA00E1  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
399
 2527                        		.LONGA	on
400
 2528                        		.MNLIST
401
 2529  FA00E3  98            		tya
402
 2530  FA00E4  65 76         		adc	cmdlin
403
 2531  FA00E6  85 76         		sta	cmdlin		; bump command line ptr
404
 2532  FA00E8                		ACC08
405
 2533  FA00E8  E2 20         		sep	#PMFLAG
406
 2534                        		.LONGA	off
407
 2535                        		.MNLIST
408
 2536  FA00EA  90 03         		bcc	?120
409
 2537  FA00EC  E6 78         		inc	cmdlin+2
410
 2538  FA00EE  18            		clc
411
 2539  FA00EF  60            	?120:	rts
412
 2540  FA00F0  A5 84         	?122:	lda	prsfg		; test bit 7
413
 2541  FA00F2  10 2A         		bpl	?124		; no show error message
414
 2542  FA00F4  20 42 01      		jsr	?128
415
 2543  FA00F7                		SCNPRINT
416
 2544  FA00F7  02 01         		cop	$01
417
 2545                        		.MNLIST
418
 2546  FA00F9  6D 69 73 73 69 		.DB	'missig quotation marks in argument.', 13, 0
419
               67 20 71 75 6F
420
               74 61 74 69 6F
421
               6E 20 6D 61 72
422
               6B 73 20 69 6E
423
               20 61 72 67 75
424
               6D 65 6E 74 2E
425
               0D 00
426
 2547  FA011E  38            	?124:	sec			; error flag
427
 2548  FA011F  60            		rts
428
 2549  FA0120  A5 84         	?126:	lda	prsfg
429
 2550  FA0122  10 FA         		bpl	?124
430
 2551  FA0124  20 42 01      		jsr	?128
431
 2552  FA0127                		SCNPRINT
432
 2553  FA0127  02 01         		cop	$01
433
 2554                        		.MNLIST
434
 2555  FA0129  61 72 67 75 6D 		.DB	'argument zero length.', 13, 0
435
  Thu Mar 24 11:31:55 2016                                                                                               Page    8
436
 
437
 
438
 
439
 
440
               65 6E 74 20 7A
441
               65 72 6F 20 6C
442
               65 6E 67 74 68
443
               2E 0D 00
444
 2556  FA0140  38            	?127:	sec
445
 2557  FA0141  60            		rts
446
 2558  FA0142  4A            	?128:	lsr	a
447
 2559  FA0143  90 05         		bcc	?129
448
 2560  FA0145                		SCNPRINT
449
 2561  FA0145  02 01         		cop	$01
450
 2562                        		.MNLIST
451
 2563  FA0147  3A 3A 00      		.DB	'::', 0
452
 2564  FA014A  60            	?129:	rts
453
 2565
454
 2566  FA014B  C8            	?130:	iny			; check option
455
 2567  FA014C  B7 76         		lda	[cmdlin],y
456
 2568  FA014E  F0 1E         		beq	?135		; missing option
457
 2569  FA0150  C9 20         		cmp	#' '
458
 2570  FA0152  F0 1A         		beq	?135		; missing option
459
 2571  FA0154  BB            		tyx
460
 2572  FA0155  85 83         		sta	chopt		; store option char
461
 2573  FA0157  A0 00         		ldy	#0		; scan option string
462
 2574  FA0159  B7 79         	?132:	lda	[optstr],y
463
 2575  FA015B  F0 2D         		beq	?136		; option not found
464
 2576  FA015D  C5 83         		cmp	chopt
465
 2577  FA015F  F0 04         		beq	?134		; found
466
 2578  FA0161  C8            		iny
467
 2579  FA0162  C8            		iny
468
 2580  FA0163  80 F4         		bra	?132
469
 2581  FA0165  C8            	?134:	iny
470
 2582  FA0166  B7 79         		lda	[optstr],y	; get option type
471
 2583  FA0168  85 85         		sta	opttyp
472
 2584  FA016A  9B            		txy
473
 2585  FA016B  C8            		iny
474
 2586  FA016C  18            		clc
475
 2587  FA016D  60            		rts
476
 2588  FA016E
477
 2589  FA016E  A5 84         	?135:	lda	prsfg
478
 2590  FA0170  10 CE         		bpl	?127
479
 2591  FA0172  20 42 01      		jsr	?128
480
 2592  FA0175                		SCNPRINT
481
 2593  FA0175  02 01         		cop	$01
482
 2594                        		.MNLIST
483
 2595  FA0177  6D 69 73 73 69 		.DB	'missing option.', 13, 0
484
               6E 67 20 6F 70
485
               74 69 6F 6E 2E
486
               0D 00
487
 2596  FA0188  38            		sec
488
 2597  FA0189  60            		rts
489
 2598
490
 2599  FA018A  A5 84         	?136:	lda	prsfg
491
 2600  FA018C  10 B2         		bpl	?127
492
 2601  FA018E  20 42 01      		jsr	?128
493
 2602  FA0191  A5 83         		lda	chopt
494
 2603  FA0193  48            		pha
495
 2604  FA0194  4B            		phk
496
 2605  FA0195  F4 9F 01      		pea	#!?138
497
  Thu Mar 24 11:31:55 2016                                                                                               Page    9
498
 
499
 
500
 
501
 
502
 2606  FA0198  A9 05         		lda	#5
503
 2607  FA019A  48            		pha
504
 2608  FA019B                		BPRINTF
505
 2609  FA019B  02 11         		cop	$11
506
 2610                        		.MNLIST
507
 2611  FA019D  38            		sec
508
 2612  FA019E  60            		rts
509
 2613
510
 2614  FA019F  69 6C 6C 65 67 	?138:	.DB	'illegal option ''-%c''.', 13, 0
511
               61 6C 20 6F 70
512
               74 69 6F 6E 20
513
               27 2D 25 63 27
514
               2E 0D 00
515
 2615
516
 2616  FA01B6  A6 85         	?140:	ldx	opttyp		; option type
517
 2617  FA01B8  B7 76         		lda	[cmdlin],y	; get char after option
518
 2618  FA01BA  F0 0B         		beq	?142		; no argument
519
 2619  FA01BC  C9 20         		cmp	#' '
520
 2620  FA01BE  F0 07         		beq	?142		; no argument
521
 2621  FA01C0  E0 20         		cpx	#' '		; option requires an argument?
522
 2622  FA01C2  F0 0A         		beq	?144		; no...so error
523
 2623  FA01C4  4C A0 00      		jmp	?110		; get argument
524
 2624  FA01C7  E0 20         	?142:	cpx	#' '		; option requires an argument?
525
 2625  FA01C9  D0 45         		bne	?148		; yes...so error
526
 2626  FA01CB  4C E1 00      		jmp	?119		; bump command line ptr
527
 2627  FA01CE
528
 2628  FA01CE  A5 84         	?144:	lda	prsfg
529
 2629  FA01D0  10 0F         		bpl	?145
530
 2630  FA01D2  20 42 01      		jsr	?128
531
 2631  FA01D5  A5 83         		lda	chopt
532
 2632  FA01D7  48            		pha
533
 2633  FA01D8  4B            		phk
534
 2634  FA01D9  F4 E3 01      		pea	#!?146
535
 2635  FA01DC  A9 05         	?144a:	lda	#5
536
 2636  FA01DE  48            		pha
537
 2637  FA01DF                		BPRINTF
538
 2638  FA01DF  02 11         		cop	$11
539
 2639                        		.MNLIST
540
 2640  FA01E1  38            	?145:	sec
541
 2641  FA01E2  60            		rts
542
 2642
543
 2643  FA01E3  6F 70 74 69 6F 	?146:	.DB	'option ''-%c'' does not requires an argument.', 13, 0
544
               6E 20 27 2D 25
545
               63 27 20 64 6F
546
               65 73 20 6E 6F
547
               74 20 72 65 71
548
               75 69 72 65 73
549
               20 61 6E 20 61
550
               72 67 75 6D 65
551
               6E 74 2E 0D 00
552
 2644
553
 2645  FA0210  A5 84         	?148:	lda	prsfg
554
 2646  FA0212  10 CD         		bpl	?145
555
 2647  FA0214  20 42 01      		jsr	?128
556
 2648  FA0217  A5 83         		lda	chopt
557
 2649  FA0219  48            		pha
558
 2650  FA021A  4B            		phk
559
  Thu Mar 24 11:31:55 2016                                                                                               Page   10
560
 
561
 
562
 
563
 
564
 2651  FA021B  F4 20 02      		pea	#!?149
565
 2652  FA021E  80 BC         		bra	?144a
566
 2653
567
 2654  FA0220  6F 70 74 69 6F 	?149:	.DB	'option ''-%c'' requires an argument.', 13, 0
568
               6E 20 27 2D 25
569
               63 27 20 72 65
570
               71 75 69 72 65
571
               73 20 61 6E 20
572
               61 72 67 75 6D
573
               65 6E 74 2E 0D
574
               00
575
 2655
576
 2656  FA0244  A5 80         	?150:	lda	slen		; check single char argument
577
 2657  FA0246  C9 01         		cmp	#1
578
 2658  FA0248  D0 0C         		bne	?152
579
 2659  FA024A  A7 7C         		lda	[dwres]
580
 2660  FA024C  85 7C         		sta	dwres
581
 2661  FA024E  64 7D         		stz	dwres+1
582
 2662  FA0250  64 7E         		stz	dwres+2
583
 2663  FA0252  64 7F         		stz	dwres+3
584
 2664  FA0254  18            		clc
585
 2665  FA0255  60            		rts
586
 2666  FA0256  A5 84         	?152:	lda	prsfg
587
 2667  FA0258  10 0F         		bpl	?154
588
 2668  FA025A  20 42 01      		jsr	?128
589
 2669  FA025D  A5 83         		lda	chopt
590
 2670  FA025F  48            		pha
591
 2671  FA0260  4B            		phk
592
 2672  FA0261  F4 6B 02      		pea	#!?156
593
 2673  FA0264  A9 05         		lda	#5
594
 2674  FA0266  48            		pha
595
 2675  FA0267                		BPRINTF
596
 2676  FA0267  02 11         		cop	$11
597
 2677                        		.MNLIST
598
 2678  FA0269  38            	?154:	sec
599
 2679  FA026A  60            		rts
600
 2680
601
 2681  FA026B  6F 70 74 69 6F 	?156:	.DB	'option ''-%c'' requires a single character argument.', 13, 0
602
               6E 20 27 2D 25
603
               63 27 20 72 65
604
               71 75 69 72 65
605
               73 20 61 20 73
606
               69 6E 67 6C 65
607
               20 63 68 61 72
608
               61 63 74 65 72
609
               20 61 72 67 75
610
               6D 65 6E 74 2E
611
               0D 00
612
 2682
613
 2683  FA029F  18            	?160:	clc
614
 2684  FA02A0  60            		rts
615
 
616
 
617
             Lines Assembled : 2635                  Errors : 0
618
 
619
 
620