Subversion Repositories MB01 Project

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
  Tue Jul 17 11:00:24 2018                                                                                               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\FF\mond.asm
13
                       Output Filename : obj\FF\mond.obj
14
                       Listing Has Been Relocated
15
 
16
 
17
 2593                        	.LIST		on
18
 2594
19
 2595  F8FFB1                		.INCLUDE inc\dirp00.inc
20
 2596                        	;----------------------------------------------------------
21
 2597                        	; DIRP00.ASM
22
 2598                        	; PROGETTO: B1601
23
 2599                        	;
24
 2600                        	; Variabili in Direct Page $00
25
 2601                        	;----------------------------------------------------------
26
 2602
27
 2603                        	; sezione COMMON -- questo permette di includere il file in piu' file
28
 2604
29
 2605                        	.LIST on
30
 2606
31
 2607                        	DIRP00:	.SECTION page0, ref_only, common	;Direct-Page 00
32
 2608
33
 2609  000000                		.ABSOLUTE		;; inizia sempre da $00
34
 2610  000000                		.ORG		0x00
35
 2611  000000
36
 2612  000000  0000          	JiffyClk	.DW			; contatore 10ms 32 bit
37
 2613  000002  0000          			.DW
38
 2614  000004                	SysTmr		.DS	SYSTMRCNT	; system timer 0 (10ms)
39
 2615  000008                	SysTMF		.DS	SYSTMRCNT	; flag timer (80 -> start)
40
 2616  00000C  00            	Bnk0Flag	.DB			; <7>: flag test RAM banco 0 ok
41
 2617                        						; <6>: flag warm reset
42
 2618  00000D  00            	RTCFlag		.DB
43
 2619
44
 2620  00000E                	diskstat	.DS	2	; flag device on ata bus #0 & #1
45
 2621                        					; <7>: device ready
46
 2622                        					; <6>: compact flash device (C.F.)
47
 2623                        					; <5>: device identification ok
48
 2624                        					; <4>: MBR loaded
49
 2625                        					; <3>: valid signature in MBR
50
 2626                        					; <2>: first partition found&active
51
 2627                        					; <1>:
52
 2628                        					; <0>: valid partition flag
53
 2629
54
 2630                        					; <7>: device ready
55
 2631                        					; <6>: USB device
56
 2632                        					; <5>: compact flash device (C.F.)
57
 2633                        					; <4>: device identification ok
58
 2634                        					; <3>: MBR loaded
59
 2635                        					; <2>: first partition found&active
60
 2636                        					; <1>: always 1
61
 2637                        					; <0>: valid partition flag
62
 2638  000010
63
  Tue Jul 17 11:00:24 2018                                                                                               Page    2
64
 
65
 
66
 
67
 
68
 2639
69
 2640          00000E        	atadev		.EQU	diskstat
70
 2641
71
 2642  000010                	usbdev		.DS	2	; flag flash disk on usb bus #0
72
 2643                        					; <7>: device plugged and ready
73
 2644                        					; <6>: always 1
74
 2645                        					; <5>: device identification ok
75
 2646                        					; <4>: MBR loaded
76
 2647                        					; <3>: valid signature in MBR
77
 2648                        					; <2>: first partition found&active
78
 2649                        					; <1>:
79
 2650                        					; <0>: valid partition flag
80
 2651
81
 2652  000012                	diskmax		.DS	16	; disk max. sector's
82
 2653          000012        	atasec		.EQU	diskmax
83
 2654          00001A        	usbsec		.EQU	diskmax+8
84
 2655
85
 2656
86
 2657  000022                	atambr		.DS	8	; data for first partition found in mbr
87
 2658                        					; first 3 bytes for start sector of partition
88
 2659                        					; last byte for partition type
89
 2660  00002A                	usbmbr		.DS	8
90
 2661
91
 2662  000032                	ataprt		.DS	8	; total sec's of first partition
92
 2663  00003A                	usbprt		.DS	8	; total sec's of first partition
93
 2664
94
 2665
95
 2666  000042  00            	usb0ch		.DB	; usb0 (ch375/ch376) flag
96
 2667                        				; <7>: module on
97
 2668                        				; <6>: ch376 flag
98
 2669                        				; <5:0>: chip version
99
 2670
100
 2671  000043  00            	usb0st		.DB	; usb0 status
101
 2672                        				; <7>: usb0 host mode ok
102
 2673                        				; <6>: flash disk attached flag
103
 2674                        				; <5>: usb device attached
104
 2675
105
 2676  000044  00            	fdcdrv		.DB		; phisycal drive status (drive #0)
106
 2677                        					; <7>: disk format established in bit 0&1
107
 2678                        					; <6>: double step seek done
108
 2679                        					; <5>: trust format bit's (set after ok r/w)
109
 2680                        					; <4>: write protect bit (if disk in drive)
110
 2681                        					; <3>: don't care
111
 2682                        					; <2>: don't care
112
 2683                        					; <1>: HD disk if set else DD disk
113
 2684                        					; <0>: CBM format if set else IBM format
114
 2685
115
 2686  000045  00            	vdrive		.DB		; virtual drive status (ram disk, drive #1)
116
 2687                        					; <7>: disk format established in bit 0&1
117
 2688                        					; <6>: change disk simulation (after format)
118
 2689                        					; <5>: don't care
119
 2690                        					; <4>: write protect bit (under sw control)
120
 2691                        					; <3>: don't care
121
 2692                        					; <2>: don't care
122
 2693                        					; <1>: HD disk if set else DD disk
123
 2694                        					; <0>: CBM format if set else IBM format
124
 2695
125
  Tue Jul 17 11:00:24 2018                                                                                               Page    3
126
 
127
 
128
 
129
 
130
 2696  000046  00            	fdcctl		.DB		; fdc controller status
131
 2697                        					; <7>: drive is attached
132
 2698                        					; <6>: drive need recalibration (restore)
133
 2699                        					; <5>: FDC controller ok
134
 2700                        					; <4>: motor on
135
 2701                        					; <3>: dma is active
136
 2702                        					; <2>: dma chip ok (post routine)
137
 2703                        					; <1>: clock rate (1=HD,0=DD)
138
 2704                        					; <0>: disk ready
139
 2705
140
 2706  000047  00            	fdctrk		.DB		; fd: current seek track
141
 2707  000048  00            	fdcerr		.DB		; fd: last error code
142
 2708  000049  00            	ataerr		.DB		; ata: last error code
143
 2709  00004A  00            	ataxer		.DB		; ata: last extended error code
144
 2710
145
 2711  00004B  00            	CtrlBrk		.DB		; flag CTRL+BREAK (NMI)
146
 2712
147
 2713  00004C  0000          	MemTop		.DW		; top memoria RAM
148
 2714  00004E  00            			.DB		; banco top mem
149
 2715
150
 2716  00004F  00            	DflTxtIn	.DB		; device di default text input
151
 2717  000050  00            	DflTxtOut	.DB		; device di default text output
152
 2718
153
 2719  000051                	COPPtr		LP		; long pointer for COP decoding
154
 2720  000054  00            	COPIdx		.DB		; COP signature/index
155
 2721
156
 2722  000055  00            	BiosEnt		.DB		; flag accesso a bios setup
157
 2723
158
 2724                        	; variabili utilizzate da ACIA
159
 2725  000056                	spwrk		.DS	$30
160
 2726
161
 2727                        	; bios mem
162
 2728  000086  0000          	nsize		.DW	; dimensione blocco da allocare
163
 2729                        	;bsize		.DW	; dimensione vera blocco free
164
 2730  000088  0000          	splitsz		.DW	; dimensione blocco splittato
165
 2731  00008A  0000          	bfree		.DW	; puntatore blocco free
166
 2732  00008C  0000          	hdrptr		.DW	; puntatore header heap
167
 2733
168
 2734  00008E  0000          	pbrklv		.DW	; current break level of current process
169
 2735  000090  0000          	pbrkmin		.DW	; minimum breal level of current process
170
 2736  000092  0000          	pbrkmax		.DW	; maximum breal level of current process
171
 2737  000094
172
 2738                        	; bios temp. work area
173
 2739  000094                	bwrktmp		.DS	$28
174
 2740
175
 2741  0000BC  00            	coptmp		.DB	; temp. used while cop
176
 2742
177
 2743  0000BD  00            	tstser		.DB	; check ser/usb test board post
178
 2744                        				; <7>: VIA2 ok
179
 2745                        				; <6>: PICRAM ok
180
 2746                        				; <1>: UART 16C550 ok
181
 2747                        				; <0>: R65C51 ok
182
 2748
183
 2749
184
 2750                        	;crc16		.DW
185
 2751
186
 2752  0000BD                		.RELATIVE
187
  Tue Jul 17 11:00:24 2018                                                                                               Page    4
188
 
189
 
190
 
191
 
192
 2753
193
 2754                        		.ENDS
194
 2755
195
 2756          [01]          	.IFDEF		_ACIA_INC_
196
 2757  F8FFB1                		.INCLUDE INC\SP.INC
197
 2758                        	;;
198
 2759                        	;; Copyright (c) 2016 Marco Granati <mg@unet.bz>
199
 2760                        	;;
200
 2761                        	;; Permission to use, copy, modify, and distribute this software for any
201
 2762                        	;; purpose with or without fee is hereby granted, provided that the above
202
 2763                        	;; copyright notice and this permission notice appear in all copies.
203
 2764                        	;;
204
 2765                        	;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
205
 2766                        	;; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
206
 2767                        	;; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
207
 2768                        	;; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
208
 2769                        	;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
209
 2770                        	;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
210
 2771                        	;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
211
 2772                        	;;
212
 2773
213
 2774                        	;; name: sp.inc
214
 2775                        	;; rev.: 2016/07/28
215
 2776                        	;; bios C816 version v1.0
216
 2777
217
 2778                        	.LIST on
218
 2779
219
 2780          000001        	SOH		.EQU	$01
220
 2781          000002        	STX		.EQU	$02
221
 2782          000003        	ETX		.EQU	$03
222
 2783          000004        	EOT		.EQU	$04
223
 2784          000005        	ENQ		.EQU	$05
224
 2785          000006        	ACK		.EQU	$06
225
 2786          000010        	DLE		.EQU	$10
226
 2787          000016        	SYN		.EQU	$16
227
 2788
228
 2789          002000        	SOBUFSIZ	.EQU	$2000	; dimensione coda TX1/TX2 ACIA (8K)
229
 2790                        	;SOBUFSIZ	.EQU	$0100	; dimensione coda TX1/TX2 ACIA (8K)
230
 2791          004000        	SIBUFSIZ	.EQU	$4000	; dimensione coda RX1/RX2 ACIA (16K)
231
 2792                        	;SIBUFSIZ	.EQU	$0100	; dimensione coda RX1/RX2 ACIA (16K)
232
 2793
233
 2794          000080        	NGUARD1		.EQU	$80	; numero bytes di guardia buffer RX XON/XOFF
234
 2795          000040        	NGUARD2		.EQU	$40	; numero bytes di guardia buffer RX handshake
235
 2796                        	;NGUARD1		.EQU	$40	; numero bytes di guardia buffer RX XON/XOFF
236
 2797                        	;NGUARD2		.EQU	$20	; numero bytes di guardia buffer RX handshake
237
 2798          001000        	NFREE1		.EQU	$1000	; minimo posto in coda RX per cancellare pausa remota
238
 2799          000800        	NFREE2		.EQU	$0800
239
 2800                        	;NGUARD3		.EQU	$F0
240
 2801                        	;NGUARD4		.EQU	$F8
241
 2802
242
 2803                        	;---------------------------------------------------------------------------
243
 2804                        	; direct page var's for serial ports handling
244
 2805                        	;---------------------------------------------------------------------------
245
 2806
246
 2807                        	DPSP:	.SECTION page0, common, ref_only, offset spwrk	;ACIA D.P.
247
 2808
248
 2809  000056                	_DPSP_START	.DS	0
249
  Tue Jul 17 11:00:24 2018                                                                                               Page    5
250
 
251
 
252
 
253
 
254
 2810
255
 2811                        	; WARNING: not change order and type of the following variables
256
 2812
257
 2813                        	; acia 1 var's
258
 2814  000056  00            	splin		.DB		; interrupt status register
259
 2815  000057  00            	spcsr		.DB		; control status register
260
 2816  000058  00            	spfr		.DB		; format register
261
 2817  000059  00            	spout		.DB		; XON/XOFF send flag
262
 2818
263
 2819                        	; acia 2 var's
264
 2820  00005A  00            	splin2		.DB		; interrupt status register
265
 2821  00005B  00            	spcsr2		.DB		; control status register
266
 2822  00005C  00            	spfr2		.DB		; format register
267
 2823  00005D  00            	spout2		.DB		; XON/XOFF send flag
268
 2824
269
 2825                        	; serial port's mode & status
270
 2826  00005E  00            	spmode		.DB		; <7>: 0=no handshake, 1=handshake
271
 2827                        					; <6>: 0=software/1=hardware handshake
272
 2828                        					; <5>: not used
273
 2829                        					; <4>: baud rate: 0=19200, 1=38400
274
 2830                        					; <3>: 0=odd parity, 1=even parity
275
 2831                        					; <2>: 0=no parity, 1=parity as specified
276
 2832                        					;      by bit <3>
277
 2833                        					; <1>: interface type: 0=RS232, 1=RS485
278
 2834                        					; <0>: RS232: uplink flow control (RTS/DCD)
279
 2835                        					;      RS485: 120 ohm termination on
280
 2836                        					; if bit 7=1 and bit 1=1, bit 6 is forced to 0
281
 2837  00005F
282
 2838  00005F  00            	spstat		.DB		; serial port status
283
 2839                        					; <7>: rx error (data discarded)
284
 2840                        					; <6>: rx buffer overflow
285
 2841                        					; <5>: remote disconnession (DSR line = 1)
286
 2842                        					; <4>: output buffer overflow
287
 2843                        					; <3>: not used
288
 2844                        					; <2>: framing error
289
 2845                        					; <1>: parity error
290
 2846                        					; <0>: overrun error
291
 2847
292
 2848  000060  00            	sppause		.DB		; local/remote pause flag's
293
 2849                        					; <7>: remote pause (sent an XON or set RTS=1)
294
 2850                        					; <6>: local pause (received an XON or CTS=1)
295
 2851
296
 2852  000061  00            	sptmp		.DB		; temp. byte used while get data
297
 2853
298
 2854                        	; serial port's mode & status
299
 2855  000062  00            	spmode2		.DB		; <7>: 0=no handshake, 1=handshake
300
 2856                        					; <6>: 0=software/1=hardware handshake
301
 2857                        					; <5>: not used
302
 2858                        					; <4>: baud rate: 0=19200, 1=38400
303
 2859                        					; <3>: 0=odd parity, 1=even parity
304
 2860                        					; <2>: 0=no parity, 1=parity as specified
305
 2861                        					;      by bit <3>
306
 2862                        					; <1>: interface type: 0=RS232, 1=RS485
307
 2863                        					; <0>: RS232: uplink flow control (RTS/DCD)
308
 2864                        					;      RS485: 120 ohm termination on
309
 2865                        					; if bit 7=1 and bit 1=1, bit 6 is forced to 0
310
 2866  000063
311
  Tue Jul 17 11:00:24 2018                                                                                               Page    6
312
 
313
 
314
 
315
 
316
 2867  000063  00            	spstat2		.DB		; serial port status
317
 2868                        					; <7>: rx error (data discarded)
318
 2869                        					; <6>: rx buffer overflow
319
 2870                        					; <5>: remote disconnession (DSR line = 1)
320
 2871                        					; <4>: output buffer overflow
321
 2872                        					; <3>: not used
322
 2873                        					; <2>: framing error
323
 2874                        					; <1>: parity error
324
 2875                        					; <0>: overrun error
325
 2876
326
 2877  000064  00            	sppause2	.DB		; local/remote pause flag's
327
 2878                        					; <7>: remote pause (sent XOFF/XON or RTS=1/0)
328
 2879                        					; <6>: local pause (rx XOFF/XON or CTS=0/1)
329
 2880
330
 2881  000065  00            	sppost		.DB		; after POST must hold $C0
331
 2882
332
 2883  000066  0000          	ibuftail	.DW		; pointer to tail of input buffer
333
 2884  000068  0000          	ibufhead	.DW		; pointer to head of input buffer
334
 2885  00006A  0000          	ibuftail2	.DW
335
 2886  00006C  0000          	ibufhead2	.DW
336
 2887
337
 2888  00006E  0000          	obuftail	.DW		; pointer to tail of output buffer
338
 2889  000070  0000          	obufhead	.DW		; pointer to head of output buffer
339
 2890  000072  0000          	obuftail2	.DW
340
 2891  000074  0000          	obufhead2	.DW
341
 2892
342
 2893  000076  0000          	ibufcnt		.DW		; count of bytes in input buffer
343
 2894  000078  0000          	obufcnt		.DW		; count of bytes in output buffer
344
 2895  00007A  0000          	ibufcnt2	.DW
345
 2896  00007C  0000          	obufcnt2	.DW
346
 2897
347
 2898  00007E  0000          	icntmin		.DW		; min. count for clear remote pause
348
 2899  000080  0000          	icntmax		.DW		; max. count for set remote pause
349
 2900  000082  0000          	icntmin2	.DW
350
 2901  000084  0000          	icntmax2	.DW
351
 2902
352
 2903  000086                	_DPSP_END	.DS	0
353
 2904          000030        	DPSPSIZ		.EQU	(_DPSP_END - _DPSP_START)
354
 2905
355
 2906
356
 2907                        		.ENDS
357
 2908
358
 2909          00005F        	ACIArxe_1	.EQU	spstat
359
 2910          000063        	ACIArxe_2	.EQU	spstat2
360
 2911          00005E        	ACIAhsk_1	.EQU	spmode
361
 2912          000062        	ACIAhsk_2	.EQU	spmode2
362
 2913          000060        	ACIAPause_1	.EQU	sppause
363
 2914          000064        	ACIAPause_2	.EQU	sppause2
364
 2915          000057        	ACIAcsr_1	.EQU	spcsr
365
 2916          00005B        	ACIAcsr_2	.EQU	spcsr2
366
 2917          000058        	ACIAfr_1	.EQU	spfr
367
 2918          00005C        	ACIAfr_2	.EQU	spfr2
368
 2919          000060        	ACIAOut_1	.EQU	sppause
369
 2920          000064        	ACIAOut_2	.EQU	sppause2
370
 2921          000076        	ACIAICnt_1	.EQU	ibufcnt
371
 2922          00007A        	ACIAICnt_2	.EQU	ibufcnt2
372
 2923          000068        	ACIAIHead_1	.EQU	ibufhead
373
  Tue Jul 17 11:00:24 2018                                                                                               Page    7
374
 
375
 
376
 
377
 
378
 2924          00006C        	ACIAIHead_2	.EQU	ibufhead2
379
 2925          000066        	ACIAITail_1	.EQU	ibuftail
380
 2926          00006A        	ACIAITail_2	.EQU	ibuftail2
381
 2927          000078        	ACIAOCnt_1	.EQU	obufcnt
382
 2928          00007C        	ACIAOCnt_2	.EQU	obufcnt2
383
 2929          000070        	ACIAOHead_1	.EQU	obufhead
384
 2930          000074        	ACIAOHead_2	.EQU	obufhead2
385
 2931          00006E        	ACIAOTail_1	.EQU	obuftail
386
 2932          000072        	ACIAOTail_2	.EQU	obuftail2
387
 2933
388
 2934          002000        	ACIAOBUFLEN	.EQU	SOBUFSIZ
389
 2935          004000        	ACIAIBUFLEN	.EQU	SIBUFSIZ
390
 2936          050000        	ACIAOUTBUF1	.EQU	SPOUTBUFF
391
 2937          052000        	ACIAOUTBUF2	.EQU	SPOUTBUFF2
392
 2938          054000        	ACIAINBUF1	.EQU	SPINBUFF
393
 2939          058000        	ACIAINBUF2	.EQU	SPINBUFF2
394
 2940
395
 2941          000061        	ACIATmp		.EQU	sptmp
396
 2942
397
 2960                        	.LIST on
398
 2961
399
 2962          000060        	KBDBUFLEN	.EQU	96		; dimensione buffer di tastiera
400
 2963
401
 2964                        	DIRP01:	.SECTION page0, ref_only, common	;Direct-Page 01
402
 2965
403
 2966  000000                		.ABSOLUTE		;; inizia sempre da $00
404
 2967  000000                		.ORG		0x00
405
 2968
406
 2969  000000
407
 2970  000000                	KbdBuf		.DS	KBDBUFLEN	; buffer della tastiera
408
 2971  000060  00            	KbdITail	.DB			; coda buffer tastiera
409
 2972  000061  00            	KbdIHead	.DB			; testa buffer tastiera
410
 2973  000062  00            	KbdCnt		.DB			; numero bytes nel buffer
411
 2974  000063  00            	KbdShift	.DB
412
 2975  000064  00            	KbdFlag		.DB
413
 2976  000065  00            	KbdToggle	.DB
414
 2977  000066  00            	KbdSt		.DB			; status tastiera dopo reset
415
 2978  000067  00            	PS2Ctl		.DB			; flag controller PS2 keyboard
416
 2979
417
 2980  000068  00            	LCDFlag		.DB
418
 2981  000069  00            	LCDTmp		.DB
419
 2982  00006A  0000          	LCDVal		.DW
420
 2983
421
 2984  00006C  00            	VBBFlag		.DB		; flag video board
422
 2985  00006D  00            	VBBRam		.DB		; flag video RAM
423
 2986
424
 2987  00006E  00            	ScnLinTmp	.DB
425
 2988  00006F  00            	ScnChBase	.DB		; base video ram VDC
426
 2989  000070  00            	ScnAttBase	.DB		; base ram attributi VDC
427
 2990  000071  00            	ScnCursMode	.DB		; VDC cursore default
428
 2991  000072  00            	ScnSaveAttr	.DB
429
 2992  000073  00            	ScnInsert	.DB
430
 2993  000074  00            	ScnAutoIns	.DB		; bit 7 -> autoins - bit 6 -> modo input
431
 2994  000075  00            	ScnScroll	.DB
432
 2995  000076  00            	ScnMaxRow	.DB		; max. righe finestra (-1)
433
 2996  000077  00            	ScnMaxCols	.DB		; max. colonne finestra (-1)
434
 2997
435
  Tue Jul 17 11:00:24 2018                                                                                               Page    8
436
 
437
 
438
 
439
 
440
 2998  000078                	ScnMapTabs1	.DS	10
441
 2999  000082                	ScnMapTabs2	.DS	4
442
 3000  000086
443
 3001  000086  0000          	ScnPtr		.DW		; puntatore video ram linea corrente
444
 3002  000088  00            			.DB
445
 3003
446
 3004  000089  00            	ScnFiltLen	.DB		; lunghezza set caratteri filtro
447
 3005
448
 3006  00008A  0000          	ScnAtPtr	.DW		; puntatore attributi ram linea corrente
449
 3007  00008C  00            			.DB
450
 3008
451
 3009  00008D  00            	ScnTmpx		.DB		; temporaneo: durante put char
452
 3010  00008E
453
 3011  00008E  00            	ScnTop		.DB		; riga superiore finestra
454
 3012  00008F  00            	ScnLeft		.DB		; colonna sinistra finestra
455
 3013  000090  00            	ScnBottom	.DB		; riga inferiore finestra
456
 3014  000091  00            	ScnRight	.DB		; colonna destra finestra
457
 3015  000092  00            	ScnAttr		.DB		; attributo default
458
 3016  000093  00            	ScnAttr2	.DB		; attributo alternativo
459
 3017  000094  00            	ScnRow		.DB		; riga cursore
460
 3018  000095  00            	ScnCol		.DB		; colonna cursore
461
 3019  000096  00            	ScnRowStart	.DB		; riga di start input
462
 3020  000097  00            	ScnInput	.DB		; riga di fine input
463
 3021  000098  00            	ScnColStart	.DB		; colonna di start input
464
 3022  000099  00            	ScnSaveX	.DB
465
 3023  00009A  00            	ScnSaveY	.DB
466
 3024  00009B  00            	ScnTmpL		.DB
467
 3025  00009C  00            	ScnTmpH		.DB
468
 3026  00009D  00            	ScnSaveRow	.DB
469
 3027  00009E  00            	ScnSaveCol	.DB
470
 3028  00009F  00            	ScnCurChr	.DB
471
 3029  0000A0  00            	ScnLstChr	.DB
472
 3030  0000A1  00            	ScnCR		.DB
473
 3031  0000A2  0000          	ScnPrm		.DW		; puntatore long utilizzato da print imm
474
 3032  0000A4  00            			.DB		; banco puntatore ScnPrm
475
 3033  0000A5  00            	ScnMode		.DB		; flag modo schermo
476
 3034
477
 3035  0000A6                	ScnPtr1		LP
478
 3036
479
 3037  0000A9  00            	ScnDefCol	.DB		; default foreground color
480
 3038
481
 3039  0000AA                	ScnPtr2		LP
482
 3040
483
 3041  0000AD  00            	ScnDefBkgCol	.DB		; default background color
484
 3042  0000AE  00            	ScnInpRow	.DB		; modo input line: riga start input
485
 3043  0000AF  00            	ScnInpCol	.DB		; modo input line: colonna start input
486
 3044  0000B0  00            	ScnLstRow	.DB		; modo input line: riga stop input
487
 3045  0000B1  00            	ScnLstCol	.DB		; modo input line: colonna stop input
488
 3046  0000B2  00            	ScnFlag		.DB		; Bit 7: input line - Bit 6: input riga unica
489
 3047  0000B3  00            	ScnMask		.DB		; flag tasti funzione editor di linea
490
 3048  0000B4  00            	ScnFilt		.DB		; filtro tasti editor di linea
491
 3049  0000B5  00            	ScnCntrl	.DB		; flag ASCII/CONTROL
492
 3050                        	;DflTxtIn	.DB		; device di default text input
493
 3051                        	;DflTxtOut	.DB		; device di default text output
494
 3052  0000B6
495
 3053          000047        	SCNCLRLEN	.EQU	($ - ScnLinTmp - 1)
496
 3054
497
  Tue Jul 17 11:00:24 2018                                                                                               Page    9
498
 
499
 
500
 
501
 
502
 3055                        	;SCNCLRLEN	.EQU	(DflTxtOut - ScnLinTmp)
503
 3056
504
 3057                        	; variabili monitor
505
 3058  0000B6  00            	SMAddrL		.DB	; address low/high
506
 3059  0000B7  00            	SMAddrH		.DB
507
 3060  0000B8  00            	SMAddrK		.DB	; address bank
508
 3061  0000B9  00            	SMFlag32	.DB	; flag parametro 32 bit
509
 3062  0000BA  00            	SMTmpL		.DB	; temp. low/high
510
 3063  0000BB  00            	SMTmpH		.DB
511
 3064  0000BC  00            	SMTmpK		.DB	; temp. bank
512
 3065  0000BD  00            	SMTmpKK		.DB	; high byte param. 32 bit
513
 3066  0000BE  00            	SMSizeL		.DB	; size low/high
514
 3067  0000BF  00            	SMSizeH		.DB
515
 3068  0000C0  00            	SMSizeK		.DB	; size bank
516
 3069  0000C1  00            	SMXAddrL	.DB	; address low/high XM
517
 3070  0000C2  00            	SMXAddrH	.DB
518
 3071  0000C3  00            	SMXAddrK	.DB	; address bank XM
519
 3072  0000C4  00            	SMbndx		.DB	; indice input buffer
520
 3073  0000C5  00            	SMnprm		.DB	; numero parametri riga di comando
521
 3074  0000C6  00            	SMdumb		.DB
522
 3075  0000C7  00            	SMkr		.DB
523
 3076  0000C8  0000          	SMpc		.DW
524
 3077  0000CA  00            	SMsr		.DB
525
 3078  0000CB  00            	SMbr		.DB
526
 3079  0000CC  0000          	SMdp		.DW
527
 3080  0000CE  0000          	SMac		.DW
528
 3081  0000D0  0000          	SMxr		.DW
529
 3082  0000D2  0000          	SMyr		.DW
530
 3083  0000D4  0000          	SMsp		.DW
531
 3084
532
 3085  0000D6  00            	SMAuxL		.DB
533
 3086  0000D7  00            	SMAuxH		.DB
534
 3087
535
 3088  0000D8  00            	asmlong		.DB	; flag for CPU in 16 mode
536
 3089                        				; <7> -> A/M in 16 bit mode
537
 3090                        				; <6> -> X/Y in 16 bit mode
538
 3091  0000D9  00            	asmcpu		.DB	; <7> -> 8 bit family
539
 3092                        				; <6> -> 65C02 cmos version
540
 3093
541
 3094  0000DA  00            	SMctx		.DB	; context (if = $00 no quit command)
542
 3095  0000DB                	SMrsm		LP	; long pointer to resume caller context
543
 3096
544
 3097  0000DE  00            	rtcadr		.DB	; rtc internal ram address
545
 3098  0000DF  00            	rtcbnk		.DB	; RTC internal bank ram
546
 3099  0000E0  00            	cmdlin		.DB	;
547
 3100  0000E1  00            	SMesc		.DB
548
 3101
549
 3102  0000E2                	SMXTmp:		.DS	26	; 26 bytes tmp
550
 3103
551
 3104          0000E2        	SMTmp2		.EQU	SMXTmp
552
 3105          0000E4        	SMTmp3		.EQU	SMXTmp+2
553
 3106          0000E6        	SMdwTmp1	.EQU	SMXTmp+4
554
 3107          0000EA        	SMdwTmp2	.EQU	SMXTmp+8
555
 3108          0000EE        	SMFsrc		.EQU	SMXTmp+12	; source bank for flash update
556
 3109          0000EF        	SMFflag		.EQU	SMXTmp+13	; flag file for flash update
557
 3110          0000F0        	SMXPos2		.EQU	SMXTmp+14
558
 3111          0000F1        	SMYPos2		.EQU	SMXTmp+15
559
  Tue Jul 17 11:00:24 2018                                                                                               Page   10
560
 
561
 
562
 
563
 
564
 3112          0000F2        	SMXPos3		.EQU	SMXTmp+16
565
 3113          0000F3        	SMYPos3		.EQU	SMXTmp+17
566
 3114                        	;SMAuxL		.EQU	SMXTmp+18
567
 3115                        	;SMAuxH		.EQU	SMXTmp+19
568
 3116          0000F6        	SMXPos		.EQU	SMXTmp+20
569
 3117          0000F7        	SMYPos		.EQU	SMXTmp+21
570
 3118          0000F8        	SMdwTmp3	.EQU	SMXTmp+22
571
 3119
572
 3120          0000E2        	atcmd		.EQU	SMXTmp		; save @ command
573
 3121          0000E3        	atnum		.EQU	SMXTmp+1	; @ command index
574
 3122          0000E4        	atflag		.EQU	SMXTmp+2	; @ L,S,V,R,W start address flag
575
 3123          0000E5        	atbnk		.EQU	SMXTmp+3	; @ L,S,V,R,W bank
576
 3124          0000E6        	atstr		.EQU	SMXTmp+4	; @ command string start (word)
577
 3125          0000E8        	atstart		.EQU	SMXTmp+6	; @ L,S,V,R,W start address (word)
578
 3126          0000EA        	atend		.EQU	SMXTmp+8	; @ S,W end address (word)
579
 3127          0000EC        	atbuf		.EQU	SMXTmp+10	; @ local buffer pointer (word)
580
 3128          0000EE        	atipb		.EQU	SMXTmp+12	; @ bank of input buffer
581
 3129          0000EF        	atdir		.EQU	SMXTmp+13	; @ load dir flag
582
 3130          0000F0        	atptr		.EQU	SMXTmp+14	; @ load dir pointer (word)
583
 3131          0000F2        	atsiz		.EQU	SMXTmp+16	; @ buffer size (word)
584
 3132          0000F5        	atlp		.EQU	SMXTmp+19	; @ long pointer
585
 3133          0000F8        	atsa		.EQU	SMXTmp+22	; @ sa
586
 3134
587
 3135          0000E2        	btmpx		.EQU	SMXTmp		; asc2bin conversion
588
 3136          0000E3        	brtcsec		.EQU	SMXTmp+1
589
 3137          0000E4        	brtcmin		.EQU	SMXTmp+2
590
 3138          0000E5        	brtchour	.EQU	SMXTmp+3
591
 3139          0000E6        	brtcday		.EQU	SMXTmp+4
592
 3140          0000E7        	brtcmonth	.EQU	SMXTmp+5
593
 3141          0000E8        	brtcyear	.EQU	SMXTmp+6
594
 3142          0000E9        	brtcct		.EQU	SMXTmp+7
595
 3143
596
 3144
597
 3145  0000FC                		.RELATIVE
598
 3146
599
 3147                        		.ENDS
600
 3148
601
 3172                        	.LIST on
602
 3173
603
 3174          05C000        	SOBUFADDR3	.EQU	SPOUTBUFF3
604
 3175          05D000        	SIBUFADDR3	.EQU	SPINBUFF3
605
 3176          001000        	SOBUFSIZ3	.EQU	$1000
606
 3177          001000        	SIBUFSIZ3	.EQU	$1000
607
 3178
608
 3179          060000        	SOBUFADDR4	.EQU	SPOUTBUFF4
609
 3180          068000        	SIBUFADDR4	.EQU	SPINBUFF4
610
 3181                        	;SOBUFSIZ4	.EQU	$1000
611
 3182                        	;SIBUFSIZ4	.EQU	$1000
612
 3183          008000        	SOBUFSIZ4	.EQU	$8000
613
 3184          008000        	SIBUFSIZ4	.EQU	$8000
614
 3185
615
 3186          000200        	NGUARD31	.EQU	$0200	; numero bytes di guardia buffer RX XON/XOFF
616
 3187          000100        	NGUARD32	.EQU	$0100	; numero bytes di guardia buffer RX handshake
617
 3188          000800        	NFREE31		.EQU	$0800	; minimo posto in coda RX per cancellare pausa remota
618
 3189          000400        	NFREE32		.EQU	$0400
619
 3190
620
 3191                        	;---------------------------------------------------------------------------
621
  Tue Jul 17 11:00:24 2018                                                                                               Page   11
622
 
623
 
624
 
625
 
626
 3192                        	; direct page var's for test serial ports/usb handling
627
 3193                        	;---------------------------------------------------------------------------
628
 3194
629
 3195                        	DPSP2:	.SECTION page0, common, ref_only	;UART D.P.
630
 3196
631
 3197  000000  00            	usbslv		.DB	; <7>: plugged-in, <6>: plug-in pending
632
 3198  000001  00            	usbum		.DB	; <7>: pending message, <6>: connected
633
 3199  000002  00            	usbcnt1		.DB	; timeout UM245 plug-in detection
634
 3200  000003                	usbbuf		.DS	8
635
 3201  00000B  00            	usbtim		.DB
636
 3202  00000C  00            	usbcnt		.DB
637
 3203  00000D  00            	usbmst		.DB
638
 3204  00000E  0000          	usbsiz		.DW
639
 3205  000010                	usbptr		LP
640
 3206  000013  00            	usbtmp		.DB
641
 3207  000014  00            	usbcmp		.DB
642
 3208
643
 3209                        	; serial port 65C51
644
 3210  000015  00            	spmode3		.DB	; <7>: 0=no handshake, 1=handshake
645
 3211                        				; <6>: 0=software/1=hardware handshake
646
 3212                        				; <5>: not used
647
 3213                        				; <4>: not used
648
 3214                        				; <3>: 0=odd parity, 1=even parity
649
 3215                        				; <2>: 0=no parity, 1=parity as specified
650
 3216                        				;      by bit <3>
651
 3217                        				; <1:0> : baud rate
652
 3218                        				;	00 =  19200
653
 3219                        				;	01 =  38400
654
 3220                        				;	10 =  57600
655
 3221                        				;	11 = 115200
656
 3222  000016
657
 3223  000016  00            	splin3		.DB	; <7>: /CTS line level
658
 3224                        				; <6>: /DSR line status
659
 3225  000017
660
 3226  000017  00            	sppause3	.DB
661
 3227  000018  00            	spout3		.DB
662
 3228  000019  00            	spstat3		.DB	; staus
663
 3229                        				; <7>: rx error (data discarded)
664
 3230                        				; <6>: rx buffer overflow
665
 3231                        				; <5>: remote disconnession (/DSR line = 1)
666
 3232                        				; <4>: output buffer overflow
667
 3233                        				; <3>: not used
668
 3234                        				; <2>: framing error
669
 3235                        				; <1>: parity error
670
 3236                        				; <0>: overrun error
671
 3237
672
 3238  00001A  00            	sptmp3		.DB
673
 3239
674
 3240  00001B  0000          	ibuftail3	.DW
675
 3241  00001D  0000          	ibufhead3	.DW
676
 3242  00001F  0000          	obuftail3	.DW
677
 3243  000021  0000          	obufhead3	.DW
678
 3244  000023  0000          	ibufcnt3	.DW
679
 3245  000025  0000          	obufcnt3	.DW
680
 3246  000027  0000          	icntmin3	.DW
681
 3247  000029  0000          	icntmax3	.DW
682
 3248
683
  Tue Jul 17 11:00:24 2018                                                                                               Page   12
684
 
685
 
686
 
687
 
688
 3249                        	; serial port 16C550
689
 3250  00002B  00            	spmode4		.DB	; <7>: 0=no handshake, 1=handshake
690
 3251                        				; <6>: 0=software/1=hardware handshake
691
 3252                        				; <5>: not used
692
 3253                        				; <4>: not used
693
 3254                        				; <3>: 0=odd parity, 1=even parity
694
 3255                        				; <2>: 0=no parity, 1=parity as specified
695
 3256                        				;      by bit <3>
696
 3257                        				; <1:0> : baud rate
697
 3258                        				;	00 =  19200
698
 3259                        				;	01 =  38400
699
 3260                        				;	10 =  57600
700
 3261                        				;	11 = 115200
701
 3262  00002C
702
 3263  00002C  00            	splin4		.DB	; <7>: /DSR line level
703
 3264                        				; <6>: /CTS line status
704
 3265  00002D
705
 3266  00002D  00            	sppause4	.DB
706
 3267  00002E  00            	spout4		.DB
707
 3268  00002F  00            	spstat4		.DB	; staus
708
 3269                        				; <7>: rx error (data discarded)
709
 3270                        				; <6>: rx buffer overflow
710
 3271                        				; <5>: remote disconnession (/DSR line = 1)
711
 3272                        				; <4>: output buffer overflow
712
 3273                        				; <3>: break
713
 3274                        				; <2>: framing error
714
 3275                        				; <1>: parity error
715
 3276                        				; <0>: overrun error
716
 3277
717
 3278  000030  00            	sptmp4		.DB
718
 3279
719
 3280  000031  0000          	ibuftail4	.DW
720
 3281  000033  0000          	ibufhead4	.DW
721
 3282  000035  0000          	obuftail4	.DW
722
 3283  000037  0000          	obufhead4	.DW
723
 3284  000039  0000          	ibufcnt4	.DW
724
 3285  00003B  0000          	obufcnt4	.DW
725
 3286  00003D  0000          	icntmin4	.DW
726
 3287  00003F  0000          	icntmax4	.DW
727
 3288
728
 3289  000041  00            	spcnt4		.DB
729
 3290  000042  00            	uartlsr		.DB
730
 3291  000043  00            	uartiir		.DB
731
 3292
732
 3293  000044                	usb0name	.DS	36
733
 3294
734
 3295                        		.ENDS
735
 3296
736
 3300                        		.LIST on
737
 3301
738
 3302          019900        	INPUTBUF	.EQU	MONBUF
739
 3303  F8FFB1
740
 3304                        		.CODEFF
741
 3305                        		.EXTERN ErrCls2, GetParm, PrintByte, PrintHex, GetParm32
742
 3306                        		.EXTERN PrintWord, CkStop, FF_Byte2Hex
743
 3307                        		.EXTERN _getopt			; FA/getopt.asm
744
 3308  FF25D1
745
  Tue Jul 17 11:00:24 2018                                                                                               Page   13
746
 
747
 
748
 
749
 
750
 3309                        		.GLOBAL Cmd_fddisk, Cmd_fdgetfmt, Cmd_fdres, Cmd_fdinit, Cmd_fdformat
751
 3310                        		.GLOBAL Cmd_fdverfmt, Cmd_fdread, Cmd_fdwrite, Cmd_fdverf, Cmd_fdlsys
752
 3311                        		.GLOBAL Cmd_fdtread, Cmd_fdtwrite, Cmd_fdtverf, Cmd_fdnew, Cmd_fdfs
753
 3312
754
 3313                        		.GLOBAL matcmd, atacmd, Cmd_mkhash
755
 3314
756
 3315                        		.LONGA	off
757
 3316                        		.LONGI	off
758
 3317
759
 3318                        	;---------------------------------------------------------------------------
760
 3319                        	; at '@' commands
761
 3320                        	;---------------------------------------------------------------------------
762
 3321
763
 3322                        	; @ commands
764
 3323  FF25D1                	matcmd:
765
 3324  FF25D1  A5 E3         		lda	<atnum
766
 3325  FF25D3  0A            		asl	a
767
 3326  FF25D4  AA            		tax
768
 3327  FF25D5  FC 02 28      		jsr	(MATVECS,x)
769
 3328                        		;SCN_CR
770
 3329  FF25D8  60            		rts
771
 3330
772
 3331                        	; '@c "command"' send command to cbm fs emulator
773
 3332  FF25D9                	matsnd:
774
 3333  FF25D9  A9 0F         		lda	#15
775
 3334  FF25DB  85 F8         		sta	<atsa
776
 3335  FF25DD
777
 3336                        	; '@o "file" chnl' - open file
778
 3337  FF25DD                	matopn:
779
 3338  FF25DD  A5 EE         		lda	<atipb		; bank of cmnd string
780
 3339  FF25DF  48            		pha
781
 3340  FF25E0  D4 E6         		pei	(atstr)		; address of cmnd string
782
 3341  FF25E2  A5 F8         		lda	<atsa		; chnl
783
 3342  FF25E4  48            		pha
784
 3343  FF25E5                		CBMFSCMD		; send command
785
 3344  FF25E5  02 80         		cop	FN_CBMFSCMD
786
 3345                        		.MNLIST
787
 3346  FF25E7  B0 01         		bcs	materr		; if error
788
 3347  FF25E9  60            		rts
789
 3348
790
 3349                        	; '@' or '@e': print error message
791
 3350  FF25EA                	materr:
792
 3351          000080        	VARSIZ	.SET	128
793
 3352  FF25EA                		SCN_CR
794
 3353  FF25EA                		SCNPRCHAR
795
 3354                        		.MLIST
796
 3355  FF25EA  02 07         		cop	$07
797
 3356                        		.MNLIST
798
 3357  FF25EC  0D            		.DB	$0D
799
 3358                        		.MNLIST
800
 3359  FF25ED                		ACC16			; make room in stack
801
 3360  FF25ED  C2 20         		rep	#PMFLAG
802
 3361                        		.LONGA	on
803
 3362                        		.MNLIST
804
 3363  FF25EF  3B            		tsc
805
 3364  FF25F0  38            		sec
806
 3365  FF25F1  E9 80 00      		sbc	#VARSIZ
807
  Tue Jul 17 11:00:24 2018                                                                                               Page   14
808
 
809
 
810
 
811
 
812
 3366  FF25F4  1B            		tcs
813
 3367  FF25F5  1A            		inc	a		; buffer pointer
814
 3368  FF25F6  A2 00         		ldx	#0
815
 3369  FF25F8  DA            		phx			; bank of buffer
816
 3370  FF25F9  48            		pha			; address of buffer
817
 3371  FF25FA  F4 80 00      		pea	#VARSIZ		; size of buffer
818
 3372  FF25FD                		ACC08
819
 3373  FF25FD  E2 20         		sep	#PMFLAG
820
 3374                        		.LONGA	off
821
 3375                        		.MNLIST
822
 3376  FF25FF  A9 0F         		lda	#15		; channel 15
823
 3377  FF2601  48            		pha
824
 3378  FF2602                		CBMFSRD			; read
825
 3379  FF2602  02 81         		cop	FN_CBMFSRW
826
 3380  FF2604  00            		.DB	$00
827
 3381                        		.MNLIST
828
 3382  FF2605                		ACC16
829
 3383  FF2605  C2 20         		rep	#PMFLAG
830
 3384                        		.LONGA	on
831
 3385                        		.MNLIST
832
 3386  FF2607  3B            		tsc
833
 3387  FF2608  1A            		inc	a		; address of buffer
834
 3388  FF2609                		ACC08
835
 3389  FF2609  E2 20         		sep	#PMFLAG
836
 3390                        		.LONGA	off
837
 3391                        		.MNLIST
838
 3392  FF260B  A2 00         		ldx	#0		; bank of buffer
839
 3393  FF260D                		SCNSTROUT		; print string
840
 3394  FF260D  02 03         		cop	$03
841
 3395                        		.MNLIST
842
 3396  FF260F                		ACC16CLC
843
 3397  FF260F  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
844
 3398                        		.LONGA	on
845
 3399                        		.MNLIST
846
 3400  FF2611  3B            		tsc			; clean stack
847
 3401  FF2612  69 80 00      		adc	#VARSIZ
848
 3402  FF2615  1B            		tcs
849
 3403  FF2616                		ACC08
850
 3404  FF2616  E2 20         		sep	#PMFLAG
851
 3405                        		.LONGA	off
852
 3406                        		.MNLIST
853
 3407  FF2618  60            		rts
854
 3408
855
 3409                        	; '@d "$[drive[:pattern[=type]]]"'
856
 3410                        	; load and print directory
857
 3411  FF2619                	matdir:
858
 3412          000080        	VARSIZ	.SET	128		; mult. of 32 !!!
859
 3413  FF2619  A5 EE         		lda	<atipb		; bank of cmnd string
860
 3414  FF261B  48            		pha
861
 3415  FF261C  D4 E6         		pei	(atstr)		; address of cmnd string
862
 3416  FF261E  A9 00         		lda	#$00		; chnl = 0
863
 3417  FF2620  48            		pha
864
 3418  FF2621                		CBMFSCMD		; send command
865
 3419  FF2621  02 80         		cop	FN_CBMFSCMD
866
 3420                        		.MNLIST
867
 3421  FF2623  B0 C5         		bcs	materr		; if error
868
 3422  FF2625                		ACC16			; make room in stack
869
  Tue Jul 17 11:00:24 2018                                                                                               Page   15
870
 
871
 
872
 
873
 
874
 3423  FF2625  C2 20         		rep	#PMFLAG
875
 3424                        		.LONGA	on
876
 3425                        		.MNLIST
877
 3426  FF2627  3B            		tsc
878
 3427  FF2628  38            		sec
879
 3428  FF2629  E9 80 00      		sbc	#VARSIZ
880
 3429  FF262C  1B            		tcs
881
 3430  FF262D  1A            		inc	a		; buffer pointer
882
 3431  FF262E  85 EC         		sta	<atbuf
883
 3432  FF2630  64 EA         		stz	<atend		; buffer count #
884
 3433  FF2632                		ACC08
885
 3434  FF2632  E2 20         		sep	#PMFLAG
886
 3435                        		.LONGA	off
887
 3436                        		.MNLIST
888
 3437  FF2634  64 EF         		stz	<atdir
889
 3438  FF2636  A9 06         		lda	#6		; offset # blocks header
890
 3439  FF2638  85 E8         		sta	<atstart
891
 3440  FF263A  64 E9         		stz	<atstart+1
892
 3441  FF263C                		SCN_CR
893
 3442  FF263C                		SCNPRCHAR
894
 3443                        		.MLIST
895
 3444  FF263C  02 07         		cop	$07
896
 3445                        		.MNLIST
897
 3446  FF263E  0D            		.DB	$0D
898
 3447                        		.MNLIST
899
 3448  FF263F  20 92 26      	?10:	jsr	?100		; load buffer
900
 3449  FF2642  F0 40         		beq	?90		; no data: end of load
901
 3450  FF2644  A4 E8         	?14:	ldy	<atstart
902
 3451  FF2646  5A            		phy
903
 3452  FF2647  B1 F0         	?14a:	lda	(atptr),y
904
 3453  FF2649  C9 20         		cmp	#' '
905
 3454  FF264B  D0 03         		bne	?14b
906
 3455  FF264D  C8            		iny
907
 3456  FF264E  80 F7         		bra	?14a
908
 3457  FF2650  84 E8         	?14b:	sty	<atstart
909
 3458  FF2652  7A            		ply
910
 3459  FF2653
911
 3460  FF2653                		ACC16CLC
912
 3461  FF2653  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
913
 3462                        		.LONGA	on
914
 3463                        		.MNLIST
915
 3464  FF2655  A5 F0         		lda	<atptr
916
 3465  FF2657  65 E8         		adc	<atstart
917
 3466  FF2659  A2 00         		ldx	#0
918
 3467  FF265B  DA            		phx			; bank of string (stack)
919
 3468  FF265C  48            		pha			; address of string
920
 3469                        		;;ldy	<atstart
921
 3470  FF265D  88            		dey
922
 3471  FF265E  88            		dey
923
 3472  FF265F  B1 F0         		lda	(atptr),y	; blocks #
924
 3473  FF2661  48            		pha
925
 3474  FF2662                		ACC08
926
 3475  FF2662  E2 20         		sep	#PMFLAG
927
 3476                        		.LONGA	off
928
 3477                        		.MNLIST
929
 3478  FF2664  4B            		phk			; bank of format
930
 3479  FF2665  F4 CF 26      		pea	#!?200		; address of format
931
  Tue Jul 17 11:00:24 2018                                                                                               Page   16
932
 
933
 
934
 
935
 
936
 3480  FF2668  A2 09         		ldx	#9		; # params
937
 3481  FF266A  DA            		phx
938
 3482  FF266B                		BPRINTF
939
 3483  FF266B  02 11         		cop	$11
940
 3484                        		.MNLIST
941
 3485  FF266D  A9 04         		lda	#4		; just header need offset = 6
942
 3486  FF266F  85 E8         		sta	<atstart
943
 3487  FF2671                		ACC16CLC
944
 3488  FF2671  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
945
 3489                        		.LONGA	on
946
 3490                        		.MNLIST
947
 3491  FF2673  A5 F0         		lda	<atptr
948
 3492  FF2675  69 20 00      		adc	#32
949
 3493  FF2678  85 F0         		sta	<atptr
950
 3494  FF267A  C5 EA         		cmp	<atend
951
 3495  FF267C                		ACC08
952
 3496  FF267C  E2 20         		sep	#PMFLAG
953
 3497                        		.LONGA	off
954
 3498                        		.MNLIST
955
 3499  FF267E  90 C4         		bcc	?14		; next line in buffer
956
 3500  FF2680  24 EF         		bit	<atdir		; bit 7 set if end
957
 3501  FF2682  10 BB         		bpl	?10		; loop
958
 3502  FF2684                	?90:	ACC16CLC
959
 3503  FF2684  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
960
 3504                        		.LONGA	on
961
 3505                        		.MNLIST
962
 3506  FF2686  3B            		tsc			; clean stack
963
 3507  FF2687  69 80 00      		adc	#VARSIZ
964
 3508  FF268A  1B            		tcs
965
 3509  FF268B                		ACC08
966
 3510  FF268B  E2 20         		sep	#PMFLAG
967
 3511                        		.LONGA	off
968
 3512                        		.MNLIST
969
 3513  FF268D  A9 00         		lda	#0
970
 3514  FF268F                		CBMFSCLS
971
 3515  FF268F  02 82         		cop	FN_CBMFSCLS
972
 3516                        		.MNLIST
973
 3517  FF2691  60            		rts
974
 3518
975
 3519  FF2692  A9 00         	?100:	lda	#0		; load buffer
976
 3520  FF2694  48            		pha			; bank of buffer
977
 3521  FF2695  D4 EC         		pei	(atbuf)		; address of buffer
978
 3522  FF2697  F4 80 00      		pea	#VARSIZ		; size of buffer
979
 3523  FF269A  A9 00         		lda	#$00
980
 3524  FF269C  48            		pha			; chnl 0
981
 3525  FF269D                		CBMFSRD			; read
982
 3526  FF269D  02 81         		cop	FN_CBMFSRW
983
 3527  FF269F  00            		.DB	$00
984
 3528                        		.MNLIST
985
 3529  FF26A0  90 12         		bcc	?104
986
 3530  FF26A2  68            		pla
987
 3531  FF26A3  68            		pla
988
 3532  FF26A4                		ACC16CLC
989
 3533  FF26A4  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
990
 3534                        		.LONGA	on
991
 3535                        		.MNLIST
992
 3536  FF26A6  3B            		tsc			; clean stack
993
  Tue Jul 17 11:00:24 2018                                                                                               Page   17
994
 
995
 
996
 
997
 
998
 3537  FF26A7  69 80 00      		adc	#VARSIZ
999
 3538  FF26AA  1B            		tcs
1000
 3539  FF26AB                		ACC08
1001
 3540  FF26AB  E2 20         		sep	#PMFLAG
1002
 3541                        		.LONGA	off
1003
 3542                        		.MNLIST
1004
 3543  FF26AD  A9 00         		lda	#0
1005
 3544  FF26AF                		CBMFSCLS
1006
 3545  FF26AF  02 82         		cop	FN_CBMFSCLS
1007
 3546                        		.MNLIST
1008
 3547  FF26B1  4C EA 25      		jmp	materr
1009
 3548  FF26B4                	?104:	ACC16
1010
 3549  FF26B4  C2 20         		rep	#PMFLAG
1011
 3550                        		.LONGA	on
1012
 3551                        		.MNLIST
1013
 3552  FF26B6  48            		pha
1014
 3553  FF26B7  68            		pla
1015
 3554  FF26B8  F0 12         		beq	?110		; end of data
1016
 3555  FF26BA  C9 80 00      		cmp	#VARSIZ
1017
 3556  FF26BD  B0 04         		bcs	?106
1018
 3557  FF26BF  A2 80         		ldx	#$80
1019
 3558  FF26C1  86 EF         		stx	<atdir		; EOF flag
1020
 3559  FF26C3  18            	?106:	clc
1021
 3560  FF26C4  65 EC         		adc	<atbuf
1022
 3561  FF26C6  85 EA         		sta	<atend		; end buffer
1023
 3562  FF26C8  A5 EC         		lda	<atbuf
1024
 3563  FF26CA  85 F0         		sta	<atptr
1025
 3564  FF26CC                	?110:	ACC08
1026
 3565  FF26CC  E2 20         		sep	#PMFLAG
1027
 3566                        		.LONGA	off
1028
 3567                        		.MNLIST
1029
 3568  FF26CE  60            		rts
1030
 3569  FF26CF
1031
 3570  FF26CF                	?200:
1032
 3571  FF26CF  25 20 34 68 75 		.DB	'% 4hu %s', $0D, 0
1033
               20 25 73 0D 00
1034
 3572
1035
 3573                        	; '@l "file" bnk [start]' load file (chnl 0)
1036
 3574  FF26D9                	matload:
1037
 3575  FF26D9  64 F8         		stz	<atsa
1038
 3576  FF26DB  80 05         		bra	matrd1
1039
 3577  FF26DD
1040
 3578  FF26DD                	matver:
1041
 3579  FF26DD  60            		rts
1042
 3580
1043
 3581                        	; '@r "file" bnk [start]' open file for read (chnl 5)
1044
 3582  FF26DE                	matrd:
1045
 3583  FF26DE  A9 05         		lda	#5
1046
 3584  FF26E0  85 F8         		sta	<atsa
1047
 3585  FF26E2                	matrd1:
1048
 3586  FF26E2                		SCN_CR
1049
 3587  FF26E2                		SCNPRCHAR
1050
 3588                        		.MLIST
1051
 3589  FF26E2  02 07         		cop	$07
1052
 3590                        		.MNLIST
1053
 3591  FF26E4  0D            		.DB	$0D
1054
 3592                        		.MNLIST
1055
  Tue Jul 17 11:00:24 2018                                                                                               Page   18
1056
 
1057
 
1058
 
1059
 
1060
 3593  FF26E5  A5 EE         		lda	<atipb		; bank of cmnd string
1061
 3594  FF26E7  48            		pha
1062
 3595  FF26E8  D4 E6         		pei	(atstr)		; address of cmnd string
1063
 3596  FF26EA  A5 F8         		lda	<atsa		; chnl = 15
1064
 3597  FF26EC  48            		pha
1065
 3598  FF26ED                		CBMFSCMD		; send command
1066
 3599  FF26ED  02 80         		cop	FN_CBMFSCMD
1067
 3600                        		.MNLIST
1068
 3601  FF26EF  90 03         		bcc	?02
1069
 3602  FF26F1  4C EA 25      	?01:	jmp	materr		; if error
1070
 3603  FF26F4  64 F5         	?02:	stz	atlp
1071
 3604  FF26F6  64 F6         		stz	atlp+1
1072
 3605  FF26F8  A5 E5         		lda	<atbnk
1073
 3606  FF26FA  85 F7         		sta	<atlp+2
1074
 3607  FF26FC                		INDEX16
1075
 3608  FF26FC  C2 10         		rep	#PXFLAG
1076
 3609                        		.LONGI	on
1077
 3610                        		.MNLIST
1078
 3611  FF26FE  A0 00 00      		ldy	#0
1079
 3612  FF2701  A9 EA         		lda	#$EA
1080
 3613  FF2703  97 F5         	?03:	sta	[atlp],y
1081
 3614  FF2705  C8            		iny
1082
 3615  FF2706  D0 FB         		bne	?03
1083
 3616  FF2708                		INDEX08
1084
 3617  FF2708  E2 10         		sep	#PXFLAG
1085
 3618                        		.LONGI	off
1086
 3619                        		.MNLIST
1087
 3620  FF270A  24 E4         		bit	<atflag
1088
 3621  FF270C                		ACC16
1089
 3622  FF270C  C2 20         		rep	#PMFLAG
1090
 3623                        		.LONGA	on
1091
 3624                        		.MNLIST
1092
 3625  FF270E  10 0E         		bpl	?04		; no start address
1093
 3626  FF2710  A5 E8         		lda	<atstart
1094
 3627  FF2712  85 F5         		sta	<atlp
1095
 3628  FF2714  38            		sec
1096
 3629  FF2715  A9 F0 FF      		lda	#$FFF0
1097
 3630  FF2718  E5 E8         		sbc	<atstart
1098
 3631  FF271A  85 F2         		sta	<atsiz
1099
 3632  FF271C  80 05         		bra	?06
1100
 3633  FF271E  A9 F0 FF      	?04:	lda	#$FFF0
1101
 3634  FF2721  85 F2         		sta	<atsiz
1102
 3635  FF2723                	?06:	ACC08
1103
 3636  FF2723  E2 20         		sep	#PMFLAG
1104
 3637                        		.LONGA	off
1105
 3638                        		.MNLIST
1106
 3639  FF2725  A5 F7         		lda	<atlp+2
1107
 3640  FF2727  48            		pha
1108
 3641  FF2728  D4 F5         		pei	(atlp)
1109
 3642  FF272A  D4 F2         		pei	(atsiz)
1110
 3643  FF272C  A5 F8         		lda	<atsa
1111
 3644  FF272E  48            		pha
1112
 3645  FF272F                		CBMFSRD			; read
1113
 3646  FF272F  02 81         		cop	FN_CBMFSRW
1114
 3647  FF2731  00            		.DB	$00
1115
 3648                        		.MNLIST
1116
 3649  FF2732  08            		php
1117
  Tue Jul 17 11:00:24 2018                                                                                               Page   19
1118
 
1119
 
1120
 
1121
 
1122
 3650  FF2733                		ACC16
1123
 3651  FF2733  C2 20         		rep	#PMFLAG
1124
 3652                        		.LONGA	on
1125
 3653                        		.MNLIST
1126
 3654  FF2735  48            		pha
1127
 3655  FF2736                		ACC08
1128
 3656  FF2736  E2 20         		sep	#PMFLAG
1129
 3657                        		.LONGA	off
1130
 3658                        		.MNLIST
1131
 3659  FF2738  A5 F8         		lda	<atsa
1132
 3660  FF273A                		CBMFSCLS
1133
 3661  FF273A  02 82         		cop	FN_CBMFSCLS
1134
 3662                        		.MNLIST
1135
 3663                        		;SCN_CR
1136
 3664  FF273C                		ACC16
1137
 3665  FF273C  C2 20         		rep	#PMFLAG
1138
 3666                        		.LONGA	on
1139
 3667                        		.MNLIST
1140
 3668  FF273E  68            		pla
1141
 3669  FF273F                		ACC08
1142
 3670  FF273F  E2 20         		sep	#PMFLAG
1143
 3671                        		.LONGA	off
1144
 3672                        		.MNLIST
1145
 3673  FF2741  EB            		xba
1146
 3674  FF2742  AA            		tax			; HI
1147
 3675  FF2743  EB            		xba			; LOW
1148
 3676  FF2744  20 48 19      		jsr	PrintWord
1149
 3677                        		;SCN_CR
1150
 3678  FF2747  28            		plp
1151
 3679  FF2748  B0 A7         		bcs	?01
1152
 3680  FF274A  60            		rts
1153
 3681
1154
 3682                        	; '@g chnl bnk [start]' - read in max. 256 bytes
1155
 3683  FF274B                	matget:
1156
 3684  FF274B                		ACC16
1157
 3685  FF274B  C2 20         		rep	#PMFLAG
1158
 3686                        		.LONGA	on
1159
 3687                        		.MNLIST
1160
 3688  FF274D  A9 00 01      		lda	#256
1161
 3689  FF2750  85 F2         		sta	<atsiz
1162
 3690  FF2752  64 F5         		stz	atlp
1163
 3691  FF2754                		ACC08
1164
 3692  FF2754  E2 20         		sep	#PMFLAG
1165
 3693                        		.LONGA	off
1166
 3694                        		.MNLIST
1167
 3695  FF2756  A5 E5         		lda	<atbnk
1168
 3696  FF2758  85 F7         		sta	<atlp+2
1169
 3697  FF275A  A5 F7         		lda	<atlp+2
1170
 3698  FF275C  48            		pha
1171
 3699  FF275D  D4 F5         		pei	(atlp)
1172
 3700  FF275F  D4 F2         		pei	(atsiz)
1173
 3701  FF2761  A5 F8         		lda	<atsa
1174
 3702  FF2763  48            		pha
1175
 3703  FF2764                		CBMFSRD			; read
1176
 3704  FF2764  02 81         		cop	FN_CBMFSRW
1177
 3705  FF2766  00            		.DB	$00
1178
 3706                        		.MNLIST
1179
  Tue Jul 17 11:00:24 2018                                                                                               Page   20
1180
 
1181
 
1182
 
1183
 
1184
 3707  FF2767  08            		php
1185
 3708  FF2768  EB            		xba
1186
 3709  FF2769  AA            		tax			; HI
1187
 3710  FF276A  EB            		xba			; LOW
1188
 3711  FF276B  20 48 19      		jsr	PrintWord
1189
 3712                        		;SCN_CR
1190
 3713  FF276E  28            		plp
1191
 3714  FF276F  90 01         		bcc	?02
1192
 3715  FF2771  60            		rts
1193
 3716  FF2772  4C EA 25      	?02:	jmp	materr		; if error
1194
 3717
1195
 3718                        	; '@p chnl bnk [start]' - write out max. 256 bytes
1196
 3719  FF2775                	matput:
1197
 3720  FF2775                		ACC16
1198
 3721  FF2775  C2 20         		rep	#PMFLAG
1199
 3722                        		.LONGA	on
1200
 3723                        		.MNLIST
1201
 3724  FF2777  A9 00 01      		lda	#256
1202
 3725  FF277A  85 F2         		sta	<atsiz
1203
 3726  FF277C  64 F5         		stz	atlp
1204
 3727  FF277E                		ACC08
1205
 3728  FF277E  E2 20         		sep	#PMFLAG
1206
 3729                        		.LONGA	off
1207
 3730                        		.MNLIST
1208
 3731  FF2780  A5 E5         		lda	<atbnk
1209
 3732  FF2782  85 F7         		sta	<atlp+2
1210
 3733  FF2784  A5 F7         		lda	<atlp+2
1211
 3734  FF2786  48            		pha
1212
 3735  FF2787  D4 F5         		pei	(atlp)
1213
 3736  FF2789  D4 F2         		pei	(atsiz)
1214
 3737  FF278B  A5 F8         		lda	<atsa
1215
 3738  FF278D  48            		pha
1216
 3739  FF278E                		CBMFSWR			; write
1217
 3740  FF278E  02 81         		cop	FN_CBMFSRW
1218
 3741  FF2790  01            		.DB	$01
1219
 3742                        		.MNLIST
1220
 3743  FF2791  08            		php
1221
 3744  FF2792  EB            		xba
1222
 3745  FF2793  AA            		tax			; HI
1223
 3746  FF2794  EB            		xba			; LOW
1224
 3747  FF2795  20 48 19      		jsr	PrintWord
1225
 3748                        		;SCN_CR
1226
 3749  FF2798  28            		plp
1227
 3750  FF2799  90 01         		bcc	?02
1228
 3751  FF279B  60            		rts
1229
 3752  FF279C  4C EA 25      	?02:	jmp	materr		; if error
1230
 3753
1231
 3754                        	; '@s "file" bnk start end' save file chnl=1
1232
 3755  FF279F                	matsave:
1233
 3756  FF279F  A9 01         		lda	#1
1234
 3757  FF27A1  85 F8         		sta	<atsa
1235
 3758  FF27A3  80 04         		bra	matwr1
1236
 3759
1237
 3760                        	; '@w "file" bnk start end'
1238
 3761  FF27A5                	matwr:
1239
 3762  FF27A5  A9 05         		lda	#5
1240
 3763  FF27A7  85 F8         		sta	<atsa
1241
  Tue Jul 17 11:00:24 2018                                                                                               Page   21
1242
 
1243
 
1244
 
1245
 
1246
 3764
1247
 3765  FF27A9                	matwr1:
1248
 3766  FF27A9                		SCN_CR
1249
 3767  FF27A9                		SCNPRCHAR
1250
 3768                        		.MLIST
1251
 3769  FF27A9  02 07         		cop	$07
1252
 3770                        		.MNLIST
1253
 3771  FF27AB  0D            		.DB	$0D
1254
 3772                        		.MNLIST
1255
 3773  FF27AC  A5 EE         		lda	<atipb		; bank of cmnd string
1256
 3774  FF27AE  48            		pha
1257
 3775  FF27AF  D4 E6         		pei	(atstr)		; address of cmnd string
1258
 3776  FF27B1  A5 F8         		lda	<atsa		; chnl = 15
1259
 3777  FF27B3  48            		pha
1260
 3778  FF27B4                		CBMFSCMD		; send command
1261
 3779  FF27B4  02 80         		cop	FN_CBMFSCMD
1262
 3780                        		.MNLIST
1263
 3781  FF27B6  90 03         		bcc	?02
1264
 3782  FF27B8  4C EA 25      	?01:	jmp	materr		; if error
1265
 3783  FF27BB  64 F5         	?02:	stz	atlp
1266
 3784  FF27BD  64 F6         		stz	atlp+1
1267
 3785  FF27BF  A5 E5         		lda	<atbnk
1268
 3786  FF27C1  85 F7         		sta	<atlp+2
1269
 3787  FF27C3                		ACC16
1270
 3788  FF27C3  C2 20         		rep	#PMFLAG
1271
 3789                        		.LONGA	on
1272
 3790                        		.MNLIST
1273
 3791  FF27C5  A5 E8         		lda	<atstart
1274
 3792  FF27C7  85 F5         		sta	<atlp
1275
 3793  FF27C9  38            		sec
1276
 3794  FF27CA  A5 EA         		lda	<atend
1277
 3795  FF27CC  E5 E8         		sbc	<atstart
1278
 3796  FF27CE  85 F2         		sta	<atsiz
1279
 3797  FF27D0                		ACC08
1280
 3798  FF27D0  E2 20         		sep	#PMFLAG
1281
 3799                        		.LONGA	off
1282
 3800                        		.MNLIST
1283
 3801  FF27D2  A5 F7         		lda	<atlp+2
1284
 3802  FF27D4  48            		pha
1285
 3803  FF27D5  D4 F5         		pei	(atlp)
1286
 3804  FF27D7  D4 F2         		pei	(atsiz)
1287
 3805  FF27D9  A5 F8         		lda	<atsa
1288
 3806  FF27DB  48            		pha
1289
 3807  FF27DC                		CBMFSWR			; write
1290
 3808  FF27DC  02 81         		cop	FN_CBMFSRW
1291
 3809  FF27DE  01            		.DB	$01
1292
 3810                        		.MNLIST
1293
 3811  FF27DF  08            		php
1294
 3812  FF27E0                		ACC16
1295
 3813  FF27E0  C2 20         		rep	#PMFLAG
1296
 3814                        		.LONGA	on
1297
 3815                        		.MNLIST
1298
 3816  FF27E2  48            		pha
1299
 3817  FF27E3                		ACC08
1300
 3818  FF27E3  E2 20         		sep	#PMFLAG
1301
 3819                        		.LONGA	off
1302
 3820                        		.MNLIST
1303
  Tue Jul 17 11:00:24 2018                                                                                               Page   22
1304
 
1305
 
1306
 
1307
 
1308
 3821  FF27E5  A5 F8         		lda	<atsa
1309
 3822  FF27E7                		CBMFSCLS
1310
 3823  FF27E7  02 82         		cop	FN_CBMFSCLS
1311
 3824                        		.MNLIST
1312
 3825                        		;SCN_CR
1313
 3826  FF27E9                		ACC16
1314
 3827  FF27E9  C2 20         		rep	#PMFLAG
1315
 3828                        		.LONGA	on
1316
 3829                        		.MNLIST
1317
 3830  FF27EB  68            		pla
1318
 3831  FF27EC                		ACC08
1319
 3832  FF27EC  E2 20         		sep	#PMFLAG
1320
 3833                        		.LONGA	off
1321
 3834                        		.MNLIST
1322
 3835  FF27EE  EB            		xba
1323
 3836  FF27EF  AA            		tax			; HI
1324
 3837  FF27F0  EB            		xba			; LOW
1325
 3838  FF27F1  20 48 19      		jsr	PrintWord
1326
 3839                        		;SCN_CR
1327
 3840  FF27F4  28            		plp
1328
 3841  FF27F5  B0 C1         		bcs	?01
1329
 3842  FF27F7  60            		rts
1330
 3843
1331
 3844                        	; '@z' - close all
1332
 3845  FF27F8                	matclsall:
1333
 3846  FF27F8  A9 0F         		lda	#15
1334
 3847  FF27FA                		CBMFSCLS
1335
 3848  FF27FA  02 82         		cop	FN_CBMFSCLS
1336
 3849                        		.MNLIST
1337
 3850  FF27FC  60            		rts
1338
 3851
1339
 3852                        	; '@x chnl' - close chnl
1340
 3853  FF27FD                	matclose:
1341
 3854  FF27FD  A5 F8         		lda	<atsa
1342
 3855  FF27FF                		CBMFSCLS
1343
 3856  FF27FF  02 82         		cop	FN_CBMFSCLS
1344
 3857                        		.MNLIST
1345
 3858  FF2801  60            		rts
1346
 3859
1347
 3860  FF2802                	MATVECS:
1348
 3861  FF2802  EA25 F827 FD27 		.DW	materr, matclsall, matclose, matget, matput
1349
               4B27 7527
1350
 3862  FF280C  1926 D925 D926 		.DW	matdir, matsnd, matload, matsave, matver
1351
               9F27 DD26
1352
 3863  FF2816  DE26 A527 DD25 		.DW	matrd, matwr, matopn
1353
 3864
1354
 3865                        	;---------------------------------------------------------------------------
1355
 3866  FF281C
1356
 3867                        	; test hash
1357
 3868          0000E2        	HASH	.EQU	SMXTmp
1358
 3869          0000E4        	FCBS	.EQU	SMXTmp+2
1359
 3870
1360
 3871  FF281C                	Cmd_mkhash:
1361
 3872  FF281C                		SCNPRCHAR
1362
 3873  FF281C  02 07         		cop	$07
1363
 3874                        		.MNLIST
1364
 3875  FF281E  0D            		.DB	KB_CR
1365
  Tue Jul 17 11:00:24 2018                                                                                               Page   23
1366
 
1367
 
1368
 
1369
 
1370
 3876
1371
 3877  FF281F  A2 0A         		ldx	#$0A
1372
 3878  FF2821  BF 70 28 FF   	?02:	lda	>TESTSTR,x
1373
 3879  FF2825  95 E4         		sta	FCBS,x
1374
 3880  FF2827  CA            		dex
1375
 3881  FF2828  10 F7         		bpl	?02
1376
 3882  FF282A  A2 E4         		ldx	#FCBS
1377
 3883  FF282C  20 3A 28      		jsr	_mkhash
1378
 3884  FF282F  A5 E2         		lda	HASH
1379
 3885  FF2831  A6 E3         		ldx	HASH+1
1380
 3886  FF2833  20 48 19      		jsr	PrintWord
1381
 3887  FF2836                		SCNPRCHAR
1382
 3888  FF2836  02 07         		cop	$07
1383
 3889                        		.MNLIST
1384
 3890  FF2838  0D            		.DB	KB_CR
1385
 3891  FF2839  60            		rts
1386
 3892  FF283A
1387
 3893  FF283A                	_mkhash:
1388
 3894  FF283A  64 E2         		stz	HASH
1389
 3895  FF283C  64 E3         		stz	HASH+1
1390
 3896  FF283E  B5 00         		lda	<0,x
1391
 3897  FF2840  F0 2D         		beq	?20
1392
 3898  FF2842  C9 E5         		cmp	#$E5
1393
 3899  FF2844  F0 29         		beq	?20
1394
 3900  FF2846  29 7F         		and	#$7F
1395
 3901  FF2848  85 E3         		sta	HASH+1
1396
 3902  FF284A  A0 0A         		ldy	#$0A
1397
 3903  FF284C                	?04:	ACC16
1398
 3904  FF284C  C2 20         		rep	#PMFLAG
1399
 3905                        		.LONGA	on
1400
 3906                        		.MNLIST
1401
 3907  FF284E  A5 E2         		lda	HASH
1402
 3908  FF2850  0A            		asl	a
1403
 3909  FF2851  69 00 00      		adc	#$0000
1404
 3910  FF2854  85 E2         		sta	HASH
1405
 3911  FF2856                		ACC08
1406
 3912  FF2856  E2 20         		sep	#PMFLAG
1407
 3913                        		.LONGA	off
1408
 3914                        		.MNLIST
1409
 3915  FF2858  E8            		inx
1410
 3916  FF2859  B5 00         		lda	<0,x
1411
 3917  FF285B  29 7F         		and	#$7F
1412
 3918  FF285D  45 E2         		eor	HASH
1413
 3919  FF285F  85 E2         		sta	HASH
1414
 3920  FF2861  88            		dey
1415
 3921  FF2862  D0 E8         		bne	?04
1416
 3922  FF2864                		ACC16
1417
 3923  FF2864  C2 20         		rep	#PMFLAG
1418
 3924                        		.LONGA	on
1419
 3925                        		.MNLIST
1420
 3926  FF2866  A5 E2         		lda	HASH
1421
 3927  FF2868  D0 03         		bne	?08
1422
 3928  FF286A  1A            		inc	a
1423
 3929  FF286B  85 E2         		sta	HASH
1424
 3930  FF286D                	?08:	ACC08
1425
 3931  FF286D  E2 20         		sep	#PMFLAG
1426
 3932                        		.LONGA	off
1427
  Tue Jul 17 11:00:24 2018                                                                                               Page   24
1428
 
1429
 
1430
 
1431
 
1432
 3933                        		.MNLIST
1433
 3934  FF286F  60            	?20:	rts
1434
 3935
1435
 3936  FF2870                	TESTSTR:
1436
 3937  FF2870  2E 2E 20 20 20 		.DB	'..         '
1437
               20 20 20 20 20
1438
               20
1439
 3938  FF287B
1440
 3939                        	; # fdlsys [drive = 0]
1441
 3940                        	; load rom.bin from floppy and store in bank $E0..$E7
1442
 3941  FF287B                	Cmd_fdlsys:
1443
 3942  FF287B  64 EF         		stz	SMFflag
1444
 3943  FF287D  A9 00         		lda	#$00
1445
 3944  FF287F  B0 12         		bcs	?04		; use default drive #0
1446
 3945  FF2881  A5 BC         		lda	SMTmpK
1447
 3946  FF2883  05 BB         		ora	SMTmpH
1448
 3947  FF2885  F0 03         		beq	?02
1449
 3948  FF2887  4C E5 2B      		jmp	CmdErr
1450
 3949  FF288A  A5 BA         	?02:	lda	SMTmpL
1451
 3950  FF288C  C9 04         		cmp	#$04
1452
 3951  FF288E  90 03         		bcc	?04
1453
 3952  FF2890  4C E5 2B      		jmp	CmdErr
1454
 3953  FF2893  85 E4         	?04:	sta	SMTmp3		; drive
1455
 3954  FF2895  AA            		tax			; X = drive
1456
 3955  FF2896                		FDCGETFMT		; get disk format
1457
 3956  FF2896  02 30         		cop	$30
1458
 3957  FF2898  04            		.DB	$04
1459
 3958                        		.MNLIST
1460
 3959  FF2899  90 03         		bcc	?06
1461
 3960  FF289B  4C 78 2B      		jmp	drs0		; error
1462
 3961  FF289E  C0 02         	?06:	cpy	#$02		; required format = $02
1463
 3962  FF28A0  F0 32         		beq	?08
1464
 3963  FF28A2                		SCNPRINT		; error
1465
 3964  FF28A2  02 01         		cop	$01
1466
 3965                        		.MNLIST
1467
 3966  FF28A4  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1468
 3967  FF28A8                		SCNPRINT
1469
 3968  FF28A8  02 01         		cop	$01
1470
 3969                        		.MNLIST
1471
 3970  FF28AA  3A 3A 45 52 52 		.DB	'::ERROR - disk format is not 02, but ', $00
1472
               4F 52 20 2D 20
1473
               64 69 73 6B 20
1474
               66 6F 72 6D 61
1475
               74 20 69 73 20
1476
               6E 6F 74 20 30
1477
               32 2C 20 62 75
1478
               74 20 00
1479
 3971  FF28D0  98            		tya
1480
 3972  FF28D1  4C 71 19      		jmp	PrintHex
1481
 3973  FF28D4  A5 E4         	?08:	lda	SMTmp3		; drive
1482
 3974  FF28D6  48            		pha
1483
 3975  FF28D7  A9 00         		lda	#$00
1484
 3976  FF28D9  48            		pha			; track = 0
1485
 3977  FF28DA  48            		pha			; buffer = 0
1486
 3978  FF28DB  48            		pha			; flag = dos format
1487
 3979  FF28DC                		FDCTKRD			; read whole track 0
1488
 3980  FF28DC  02 35         		cop	$35
1489
  Tue Jul 17 11:00:24 2018                                                                                               Page   25
1490
 
1491
 
1492
 
1493
 
1494
 3981  FF28DE  00            		.DB	$00
1495
 3982                        		.MNLIST
1496
 3983  FF28DF  90 03         		bcc	?10
1497
 3984  FF28E1  4C F5 2D      		jmp	fdcr		; error
1498
 3985  FF28E4                	?10:	INDEX16
1499
 3986  FF28E4  C2 10         		rep	#PXFLAG
1500
 3987                        		.LONGI	on
1501
 3988                        		.MNLIST
1502
 3989  FF28E6  A0 00 26      		ldy	#$2600		; start of root directory
1503
 3990  FF28E9  84 BA         		sty	SMTmpL
1504
 3991  FF28EB                		INDEX08
1505
 3992  FF28EB  E2 10         		sep	#PXFLAG
1506
 3993                        		.LONGI	off
1507
 3994                        		.MNLIST
1508
 3995  FF28ED  A9 02         		lda	#$02
1509
 3996  FF28EF  85 BC         		sta	SMTmpK
1510
 3997  FF28F1  A7 BA         	?12:	lda	[SMTmpL]	; scan root directory
1511
 3998  FF28F3  D0 2A         		bne	?16
1512
 3999  FF28F5                	?14:	SCNPRINT		; error -- end of root directory
1513
 4000  FF28F5  02 01         		cop	$01
1514
 4001                        		.MNLIST
1515
 4002  FF28F7  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1516
 4003  FF28FB                		SCNPRINT
1517
 4004  FF28FB  02 01         		cop	$01
1518
 4005                        		.MNLIST
1519
 4006  FF28FD  3A 3A 45 52 52 		.DB	'::ERROR - file ROM.BIN not found', $00
1520
               4F 52 20 2D 20
1521
               66 69 6C 65 20
1522
               52 4F 4D 2E 42
1523
               49 4E 20 6E 6F
1524
               74 20 66 6F 75
1525
               6E 64 00
1526
 4007  FF291E  60            		rts
1527
 4008  FF291F  A2 00         	?16:	ldx	#0		; search 'rom.bin'
1528
 4009  FF2921  9B            		txy
1529
 4010  FF2922  B7 BA         	?16l:	lda	[SMTmpL],y
1530
 4011  FF2924  DF 3A 2B FF   		cmp	>SYNAM,x
1531
 4012  FF2928  F0 12         		beq	?17
1532
 4013  FF292A                		ACC16CLC
1533
 4014  FF292A  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
1534
 4015                        		.LONGA	on
1535
 4016                        		.MNLIST
1536
 4017  FF292C  A5 BA         		lda	SMTmpL
1537
 4018  FF292E  69 20 00      		adc	#$0020
1538
 4019  FF2931  85 BA         		sta	SMTmpL
1539
 4020  FF2933  C9 00 42      		cmp	#$4200		; end of root directory?
1540
 4021  FF2936                		ACC08
1541
 4022  FF2936  E2 20         		sep	#PMFLAG
1542
 4023                        		.LONGA	off
1543
 4024                        		.MNLIST
1544
 4025  FF2938  90 B7         		bcc	?12		; loop scan
1545
 4026  FF293A  B0 B9         		bcs	?14		; end of root directory
1546
 4027  FF293C  C8            	?17:	iny
1547
 4028  FF293D  E8            		inx
1548
 4029  FF293E  E0 0B         		cpx	#$0B
1549
 4030  FF2940  90 E0         		bcc	?16l
1550
 4031  FF2942  B7 BA         		lda	[SMTmpL],y	; name ok -- check record
1551
  Tue Jul 17 11:00:24 2018                                                                                               Page   26
1552
 
1553
 
1554
 
1555
 
1556
 4032  FF2944  C9 20         		cmp	#$20		; attribute
1557
 4033  FF2946  F0 29         		beq	?20
1558
 4034  FF2948                	?18:	SCNPRINT		; error -- entry not valid
1559
 4035  FF2948  02 01         		cop	$01
1560
 4036                        		.MNLIST
1561
 4037  FF294A  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1562
 4038  FF294E                		SCNPRINT
1563
 4039  FF294E  02 01         		cop	$01
1564
 4040                        		.MNLIST
1565
 4041  FF2950  3A 3A 45 52 52 		.DB	'::ERROR - invalid ROM.BIN entry', $00
1566
               4F 52 20 2D 20
1567
               69 6E 76 61 6C
1568
               69 64 20 52 4F
1569
               4D 2E 42 49 4E
1570
               20 65 6E 74 72
1571
               79 00
1572
 4042  FF2970  60            		rts
1573
 4043  FF2971  A0 1A         	?20:	ldy	#$1A		; check cluster
1574
 4044  FF2973  B7 BA         		lda	[SMTmpL],y
1575
 4045  FF2975  C9 02         		cmp	#$02
1576
 4046  FF2977  D0 CF         		bne	?18		; will be cluster #2
1577
 4047  FF2979  C8            		iny
1578
 4048  FF297A  B7 BA         		lda	[SMTmpL],y
1579
 4049  FF297C  D0 CA         		bne	?18
1580
 4050  FF297E  C8            		iny
1581
 4051  FF297F  C8            		iny
1582
 4052  FF2980  C8            		iny
1583
 4053  FF2981                		ACC16			; test size
1584
 4054  FF2981  C2 20         		rep	#PMFLAG
1585
 4055                        		.LONGA	on
1586
 4056                        		.MNLIST
1587
 4057  FF2983  B7 BA         		lda	[SMTmpL],y	; size H
1588
 4058  FF2985  85 E8         		sta	SMdwTmp1+2
1589
 4059  FF2987  88            		dey
1590
 4060  FF2988  88            		dey
1591
 4061  FF2989  B7 BA         		lda	[SMTmpL],y	; size L
1592
 4062  FF298B  85 E6         		sta	SMdwTmp1
1593
 4063  FF298D                		ACC08
1594
 4064  FF298D  E2 20         		sep	#PMFLAG
1595
 4065                        		.LONGA	off
1596
 4066                        		.MNLIST
1597
 4067  FF298F  D0 B7         		bne	?18		; size L must be 0
1598
 4068  FF2991  A5 E9         		lda	SMdwTmp1+3
1599
 4069  FF2993  D0 B3         		bne	?18		; must be 0
1600
 4070  FF2995  A5 E8         		lda	SMdwTmp1+2
1601
 4071  FF2997  C9 08         		cmp	#$08
1602
 4072  FF2999  D0 AD         		bne	?18		; must be 0
1603
 4073                        		; now check FAT 1 -- ROM.BIN must be in sqeuential clusters
1604
 4074                        		; starting from cluster #2 - last cluster $0402
1605
 4075  FF299B  A0 01         		ldy	#1
1606
 4076  FF299D                		CPU16
1607
 4077  FF299D  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
1608
 4078                        		.LONGA	on
1609
 4079                        		.LONGI	on
1610
 4080                        		.MNLIST
1611
 4081  FF299F  A9 00 02      		lda	#$0200		; start of FAT #1
1612
 4082  FF29A2  85 BA         		sta	SMTmpL
1613
  Tue Jul 17 11:00:24 2018                                                                                               Page   27
1614
 
1615
 
1616
 
1617
 
1618
 4083  FF29A4  A7 BA         		lda	[SMTmpL]
1619
 4084  FF29A6  C9 F0 FF      		cmp	#$FFF0
1620
 4085  FF29A9  D0 34         		bne	?28
1621
 4086  FF29AB  B7 BA         		lda	[SMTmpL],y	; must be $FFFF
1622
 4087  FF29AD  1A            		inc	a
1623
 4088  FF29AE  D0 2F         		bne	?28
1624
 4089  FF29B0  C8            		iny
1625
 4090  FF29B1  C8            		iny
1626
 4091  FF29B2  84 EA         		sty	SMdwTmp2	; next expected cluster
1627
 4092  FF29B4  B7 BA         	?22:	lda	[SMTmpL],y
1628
 4093  FF29B6  29 FF 0F      		and	#$0FFF		; mask 12 bit low
1629
 4094  FF29B9  C5 EA         		cmp	SMdwTmp2	; even cluster
1630
 4095  FF29BB  D0 22         		bne	?28		; unmatch
1631
 4096  FF29BD  C8            		iny			; 12 bit high
1632
 4097  FF29BE  C9 01 04      		cmp	#$0401
1633
 4098  FF29C1  D0 07         		bne	?24
1634
 4099  FF29C3  A9 FF 0F      		lda	#$0FFF
1635
 4100  FF29C6  85 EA         		sta	SMdwTmp2	; mark last cluster
1636
 4101  FF29C8  80 02         		bra	?26
1637
 4102  FF29CA  E6 EA         	?24:	inc	SMdwTmp2
1638
 4103  FF29CC  B7 BA         	?26:	lda	[SMTmpL],y
1639
 4104  FF29CE  4A            		lsr	a
1640
 4105  FF29CF  4A            		lsr	a
1641
 4106  FF29D0  4A            		lsr	a
1642
 4107  FF29D1  4A            		lsr	a		; odd cluster
1643
 4108  FF29D2  C8            		iny
1644
 4109  FF29D3  C8            		iny			; next FAT entry
1645
 4110  FF29D4  C5 EA         		cmp	SMdwTmp2	; even cluster
1646
 4111  FF29D6  D0 07         		bne	?28
1647
 4112  FF29D8  E6 EA         		inc	SMdwTmp2
1648
 4113  FF29DA  C9 FF 0F      		cmp	#$0FFF
1649
 4114  FF29DD  D0 D5         		bne	?22		; loop
1650
 4115  FF29DF                	?28:	CPU08
1651
 4116  FF29DF  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
1652
 4117                        		.LONGA	off
1653
 4118                        		.LONGI	off
1654
 4119                        		.MNLIST
1655
 4120  FF29E1  F0 1F         		beq	?30		; ok -- check FAT done
1656
 4121  FF29E3                		SCNPRINT		; error -- invalid FAT
1657
 4122  FF29E3  02 01         		cop	$01
1658
 4123                        		.MNLIST
1659
 4124  FF29E5  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1660
 4125  FF29E9                		SCNPRINT
1661
 4126  FF29E9  02 01         		cop	$01
1662
 4127                        		.MNLIST
1663
 4128  FF29EB  3A 3A 45 52 52 		.DB	'::ERROR - invalid FAT', $00
1664
               4F 52 20 2D 20
1665
               69 6E 76 61 6C
1666
               69 64 20 46 41
1667
               54 00
1668
 4129  FF2A01  60            		rts
1669
 4130  FF2A02                	?30:	SCNPRINT
1670
 4131  FF2A02  02 01         		cop	$01
1671
 4132                        		.MNLIST
1672
 4133  FF2A04  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1673
 4134  FF2A08                		SCNPRINT
1674
 4135  FF2A08  02 01         		cop	$01
1675
  Tue Jul 17 11:00:24 2018                                                                                               Page   28
1676
 
1677
 
1678
 
1679
 
1680
 4136                        		.MNLIST
1681
 4137  FF2A0A  3A 3A 6C 6F 61 		.DB	'::load "ROM.BIN" from bank $E0 to bank $E7', $00
1682
               64 20 22 52 4F
1683
               4D 2E 42 49 4E
1684
               22 20 66 72 6F
1685
               6D 20 62 61 6E
1686
               6B 20 24 45 30
1687
               20 74 6F 20 62
1688
               61 6E 6B 20 24
1689
               45 37 00
1690
 4138  FF2A35  A9 E0         		lda	#$E0
1691
 4139  FF2A37  85 FA         		sta	SMdwTmp3+2
1692
 4140  FF2A39  A9 01         		lda	#1
1693
 4141  FF2A3B  85 E5         		sta	SMTmp3+1	; track = 1
1694
 4142  FF2A3D  A0 00         		ldy	#0
1695
 4143  FF2A3F                		CPU16
1696
 4144  FF2A3F  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
1697
 4145                        		.LONGA	on
1698
 4146                        		.LONGI	on
1699
 4147                        		.MNLIST
1700
 4148  FF2A41  A9 00 42      		lda	#$4200		; start of cluster #2
1701
 4149  FF2A44  85 BA         		sta	SMTmpL
1702
 4150  FF2A46  64 F8         		stz	SMdwTmp3
1703
 4151  FF2A48  B7 BA         	?34:	lda	[SMTmpL],y	; copy the last 3 sectors of track 0, head 1
1704
 4152  FF2A4A  97 F8         		sta	[SMdwTmp3],y
1705
 4153  FF2A4C  C8            		iny
1706
 4154  FF2A4D  C8            		iny
1707
 4155  FF2A4E  C0 00 06      		cpy	#$0600
1708
 4156  FF2A51  90 F5         		bcc	?34
1709
 4157  FF2A53  84 F8         		sty	SMdwTmp3	; update dest pointer
1710
 4158  FF2A55  84 E6         		sty	SMdwTmp1	; count moved bytes
1711
 4159  FF2A57  64 E8         		stz	SMdwTmp1+2
1712
 4160  FF2A59  64 BA         		stz	SMTmpL		; buffer pointer
1713
 4161  FF2A5B                		CPU08
1714
 4162  FF2A5B  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
1715
 4163                        		.LONGA	off
1716
 4164                        		.LONGI	off
1717
 4165                        		.MNLIST
1718
 4166  FF2A5D  A5 E4         	?36:	lda	SMTmp3		; loop track 1..28
1719
 4167  FF2A5F  48            		pha			; drive
1720
 4168  FF2A60  A5 E5         		lda	SMTmp3+1
1721
 4169  FF2A62  48            		pha			; track
1722
 4170  FF2A63  F4 00 00      		pea	#0		; buffer = 0, flag = 0
1723
 4171  FF2A66                		FDCTKRD			; read whole track
1724
 4172  FF2A66  02 35         		cop	$35
1725
 4173  FF2A68  00            		.DB	$00
1726
 4174                        		.MNLIST
1727
 4175  FF2A69  90 03         		bcc	?38
1728
 4176  FF2A6B  4C F5 2D      		jmp	fdcr		; error
1729
 4177  FF2A6E  20 10 2B      	?38:	jsr	?100		; move bytes
1730
 4178  FF2A71  A6 E5         	?42:	ldx	SMTmp3+1
1731
 4179  FF2A73  E8            		inx
1732
 4180  FF2A74  86 E5         		stx	SMTmp3+1
1733
 4181  FF2A76  E0 1D         		cpx	#29
1734
 4182  FF2A78  90 E3         		bcc	?36		; loop track 1..28
1735
 4183  FF2A7A  A5 E4         		lda	SMTmp3
1736
 4184  FF2A7C  48            		pha			; drive
1737
  Tue Jul 17 11:00:24 2018                                                                                               Page   29
1738
 
1739
 
1740
 
1741
 
1742
 4185  FF2A7D  DA            		phx			; track 29
1743
 4186  FF2A7E  A9 00         		lda	#0
1744
 4187  FF2A80  48            		pha			; head = 0
1745
 4188  FF2A81  1A            		inc	a
1746
 4189  FF2A82  48            		pha			; secror = 1
1747
 4190  FF2A83  A9 0D         		lda	#13
1748
 4191  FF2A85  48            		pha			; read 13 sectors
1749
 4192  FF2A86  F4 00 00      		pea	#0		; buffer = 0, flag = 0
1750
 4193  FF2A89                		FDCREAD
1751
 4194  FF2A89  02 31         		cop	$31
1752
 4195  FF2A8B  00            		.DB	$00
1753
 4196                        		.MNLIST
1754
 4197  FF2A8C  90 03         		bcc	?44
1755
 4198  FF2A8E  4C F5 2D      		jmp	fdcr
1756
 4199  FF2A91  20 10 2B      	?44:	jsr	?100		; move bytes
1757
 4200  FF2A94                		SCNPRCHAR
1758
 4201  FF2A94  02 07         		cop	$07
1759
 4202                        		.MNLIST
1760
 4203  FF2A96  0D            		.DB	KB_CR
1761
 4204  FF2A97  A5 E8         		lda	SMdwTmp1+2
1762
 4205  FF2A99  20 71 19      		jsr	PrintHex	; number of bytes
1763
 4206  FF2A9C  A5 E6         		lda	SMdwTmp1
1764
 4207  FF2A9E  A6 E7         		ldx	SMdwTmp1+1
1765
 4208  FF2AA0  20 48 19      		jsr	PrintWord	; number of bytes
1766
 4209  FF2AA3  A5 FA         		lda	SMdwTmp3+2
1767
 4210  FF2AA5  20 71 19      		jsr	PrintHex	; final address +1
1768
 4211  FF2AA8  A5 F8         		lda	SMdwTmp3
1769
 4212  FF2AAA  A6 F9         		ldx	SMdwTmp3+1
1770
 4213  FF2AAC  20 48 19      		jsr	PrintWord
1771
 4214  FF2AAF  A5 E6         		lda	SMdwTmp1
1772
 4215  FF2AB1  05 E7         		ora	SMdwTmp1+1	; must be null
1773
 4216  FF2AB3  D0 12         		bne	?46
1774
 4217  FF2AB5  A5 F8         		lda	SMdwTmp3
1775
 4218  FF2AB7  05 F9         		ora	SMdwTmp3+1	; must be null
1776
 4219  FF2AB9  D0 0C         		bne	?46
1777
 4220  FF2ABB  A5 E8         		lda	SMdwTmp1+2
1778
 4221  FF2ABD  C9 08         		cmp	#$08		; must be = 8
1779
 4222  FF2ABF  D0 06         		bne	?46
1780
 4223  FF2AC1  A5 FA         		lda	SMdwTmp3+2
1781
 4224  FF2AC3  C9 E8         		cmp	#$E8		; must be = E8
1782
 4225  FF2AC5  F0 28         		beq	?48
1783
 4226  FF2AC7                	?46:	SCNPRINT
1784
 4227  FF2AC7  02 01         		cop	$01
1785
 4228                        		.MNLIST
1786
 4229  FF2AC9  20 2D 2D 20 45 		.DB	' -- ERROR -- flash cannot be updated', $00
1787
               52 52 4F 52 20
1788
               2D 2D 20 66 6C
1789
               61 73 68 20 63
1790
               61 6E 6E 6F 74
1791
               20 62 65 20 75
1792
               70 64 61 74 65
1793
               64 00
1794
 4230  FF2AEE  60            		rts
1795
 4231  FF2AEF  A9 80         	?48:	lda	#$80
1796
 4232  FF2AF1  85 EF         		sta	SMFflag
1797
 4233  FF2AF3                		SCNPRINT
1798
 4234  FF2AF3  02 01         		cop	$01
1799
  Tue Jul 17 11:00:24 2018                                                                                               Page   30
1800
 
1801
 
1802
 
1803
 
1804
 4235                        		.MNLIST
1805
 4236  FF2AF5  20 4F 4B 3A 20 		.DB	' OK: flash can be updated', $00
1806
               66 6C 61 73 68
1807
               20 63 61 6E 20
1808
               62 65 20 75 70
1809
               64 61 74 65 64
1810
               00
1811
 4237  FF2B0F  60            		rts
1812
 4238  FF2B10  A0 00         	?100:	ldy	#0
1813
 4239  FF2B12                		CPU16
1814
 4240  FF2B12  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
1815
 4241                        		.LONGA	on
1816
 4242                        		.LONGI	on
1817
 4243                        		.MNLIST
1818
 4244  FF2B14  85 EA         		sta	SMdwTmp2	; number of bytes
1819
 4245  FF2B16  B7 BA         	?200:	lda	[SMTmpL],y	; copy 36 sectors
1820
 4246  FF2B18  97 F8         		sta	[SMdwTmp3],y
1821
 4247  FF2B1A  C8            		iny
1822
 4248  FF2B1B  C8            		iny
1823
 4249  FF2B1C  C4 EA         		cpy	SMdwTmp2
1824
 4250  FF2B1E  90 F6         		bcc	?200
1825
 4251  FF2B20  A5 E6         		lda	SMdwTmp1
1826
 4252  FF2B22  18            		clc
1827
 4253  FF2B23  65 EA         		adc	SMdwTmp2	; update count of moved bytes
1828
 4254  FF2B25  85 E6         		sta	SMdwTmp1
1829
 4255  FF2B27  A5 E8         		lda	SMdwTmp1+2
1830
 4256  FF2B29  69 00 00      		adc	#$0000
1831
 4257  FF2B2C  85 E8         		sta	SMdwTmp1+2
1832
 4258  FF2B2E  98            		tya
1833
 4259  FF2B2F  65 F8         		adc	SMdwTmp3	; update dest pointer
1834
 4260  FF2B31  85 F8         		sta	SMdwTmp3
1835
 4261  FF2B33                		CPU08
1836
 4262  FF2B33  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
1837
 4263                        		.LONGA	off
1838
 4264                        		.LONGI	off
1839
 4265                        		.MNLIST
1840
 4266  FF2B35  90 02         		bcc	?202
1841
 4267  FF2B37  E6 FA         		inc	SMdwTmp3+2
1842
 4268  FF2B39  60            	?202:	rts
1843
 4269
1844
 4270  FF2B3A                	SYNAM:
1845
 4271  FF2B3A  52 4F 4D 20 20 		.DB	'ROM     BIN'
1846
               20 20 20 42 49
1847
               4E
1848
 4272  FF2B45
1849
 4273
1850
 4274                        	; # fdnew fmt0 [fmt1 = $80]
1851
 4275  FF2B45                	Cmd_fdnew:
1852
 4276  FF2B45  90 03         		bcc	?00
1853
 4277  FF2B47  4C E5 2B      		jmp	CmdErr		; no parametri
1854
 4278  FF2B4A  A5 BC         	?00:	lda	SMTmpK
1855
 4279  FF2B4C  05 BB         		ora	SMTmpH
1856
 4280  FF2B4E  F0 03         		beq	?01
1857
 4281  FF2B50  4C E5 2B      		jmp	CmdErr
1858
 4282  FF2B53  A5 BA         	?01:	lda	SMTmpL
1859
 4283  FF2B55  48            		pha			; format #0
1860
 4284  FF2B56  20 5A 01      		jsr	GetParm		; format #1
1861
  Tue Jul 17 11:00:24 2018                                                                                               Page   31
1862
 
1863
 
1864
 
1865
 
1866
 4285  FF2B59  90 04         		bcc	?02
1867
 4286  FF2B5B  A9 80         		lda	#$80
1868
 4287  FF2B5D  85 BA         		sta	SMTmpL
1869
 4288  FF2B5F  FA            	?02:	plx			; X = format #0
1870
 4289  FF2B60  A4 BA         		ldy	SMTmpL		; Y = format #1
1871
 4290  FF2B62                		FDNEWRD
1872
 4291  FF2B62  02 30         		cop	$30
1873
 4292  FF2B64  02            		.DB	$02
1874
 4293                        		.MNLIST
1875
 4294  FF2B65  80 55         		bra	drs
1876
 4295
1877
 4296                        	; # fdgetfmt [0=default|1] - get current disk format
1878
 4297  FF2B67                	Cmd_fdgetfmt:
1879
 4298  FF2B67  F0 06         		beq	?01
1880
 4299  FF2B69  A5 BC         		lda	SMTmpK
1881
 4300  FF2B6B  05 BB         		ora	SMTmpH
1882
 4301  FF2B6D  D0 76         		bne	CmdErr
1883
 4302  FF2B6F  A6 BA         	?01:	ldx	SMTmpL
1884
 4303  FF2B71  C9 04         		cmp	#$04
1885
 4304  FF2B73  B0 70         		bcs	CmdErr
1886
 4305  FF2B75                		FDCGETFMT
1887
 4306  FF2B75  02 30         		cop	$30
1888
 4307  FF2B77  04            		.DB	$04
1889
 4308                        		.MNLIST
1890
 4309                        		;FDCGETST
1891
 4310  FF2B78  08            	drs0:	php
1892
 4311  FF2B79                		SCNPRINT	; clear result line
1893
 4312  FF2B79  02 01         		cop	$01
1894
 4313                        		.MNLIST
1895
 4314  FF2B7B  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1896
 4315  FF2B7F  28            		plp
1897
 4316  FF2B80  90 15         		bcc	?02
1898
 4317  FF2B82                		SCNPRINT
1899
 4318  FF2B82  02 01         		cop	$01
1900
 4319                        		.MNLIST
1901
 4320  FF2B84  3A 3A 65 72 72 		.DB	'::error code -> ', $00
1902
               6F 72 20 63 6F
1903
               64 65 20 2D 3E
1904
               20 00
1905
 4321  FF2B95  80 09         		bra	?04
1906
 4322  FF2B97                	?02:	SCNPRINT
1907
 4323  FF2B97  02 01         		cop	$01
1908
 4324                        		.MNLIST
1909
 4325  FF2B99  3A 3A 4F 4B 2C 		.DB	'::OK, ', $00
1910
               20 00
1911
 4326  FF2BA0  98            	?04:	tya
1912
 4327  FF2BA1  4C 71 19      		jmp	PrintHex
1913
 4328  FF2BA4
1914
 4329                        	; # fdres  - reset FDC controller
1915
 4330  FF2BA4                	Cmd_fdres:
1916
 4331  FF2BA4  D0 3F         		bne	CmdErr
1917
 4332  FF2BA6                		FDCRESET
1918
 4333  FF2BA6  02 30         		cop	$30
1919
 4334  FF2BA8  00            		.DB	$00
1920
 4335                        		.MNLIST
1921
 4336  FF2BA9  80 11         		bra	drs
1922
 4337
1923
  Tue Jul 17 11:00:24 2018                                                                                               Page   32
1924
 
1925
 
1926
 
1927
 
1928
 4338                        	; # fddisk [0=default|1] - check drive for disk inserted
1929
 4339  FF2BAB                	Cmd_fddisk:
1930
 4340  FF2BAB  F0 06         		beq	?01
1931
 4341  FF2BAD  A5 BC         		lda	SMTmpK
1932
 4342  FF2BAF  05 BB         		ora	SMTmpH
1933
 4343  FF2BB1  D0 32         		bne	CmdErr
1934
 4344  FF2BB3  A6 BA         	?01:	ldx	SMTmpL
1935
 4345  FF2BB5  E0 04         		cpx	#$04
1936
 4346  FF2BB7  B0 2C         		bcs	CmdErr
1937
 4347  FF2BB9                		FDCTST
1938
 4348  FF2BB9  02 30         		cop	$30
1939
 4349  FF2BBB  03            		.DB	$03
1940
 4350                        		.MNLIST
1941
 4351  FF2BBC  08            	drs:	php
1942
 4352  FF2BBD                		SCNPRINT	; clear result line
1943
 4353  FF2BBD  02 01         		cop	$01
1944
 4354                        		.MNLIST
1945
 4355  FF2BBF  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1946
 4356  FF2BC3  28            		plp
1947
 4357  FF2BC4  90 17         		bcc	?02
1948
 4358  FF2BC6                		SCNPRINT
1949
 4359  FF2BC6  02 01         		cop	$01
1950
 4360                        		.MNLIST
1951
 4361  FF2BC8  3A 3A 65 72 72 		.DB	'::error code -> ', $00
1952
               6F 72 20 63 6F
1953
               64 65 20 2D 3E
1954
               20 00
1955
 4362  FF2BD9  98            		tya
1956
 4363  FF2BDA  4C 71 19      		jmp	PrintHex
1957
 4364  FF2BDD                	?02:	SCNPRINT
1958
 4365  FF2BDD  02 01         		cop	$01
1959
 4366                        		.MNLIST
1960
 4367  FF2BDF  3A 3A 4F 4B 00 		.DB	'::OK', $00
1961
 4368  FF2BE4  60            		rts
1962
 4369
1963
 4370  FF2BE5                	CmdErr:
1964
 4371  FF2BE5  4C 34 01      		jmp	ErrCls2
1965
 4372
1966
 4373                        	; # fdinit - reset FDC controller and check drives
1967
 4374  FF2BE8                	Cmd_fdinit:
1968
 4375  FF2BE8  D0 FB         		bne	CmdErr
1969
 4376  FF2BEA  A9 40         		lda	#$40
1970
 4377  FF2BEC  1C 55 00      		trb	!BiosEnt
1971
 4378  FF2BEF  A9 04         		lda	#$04
1972
 4379  FF2BF1  2C 46 00      		bit	!fdcctl
1973
 4380  FF2BF4  F0 09         		beq	?10		; skip test FDC
1974
 4381  FF2BF6                		SCNPRINT	; clear result line
1975
 4382  FF2BF6  02 01         		cop	$01
1976
 4383                        		.MNLIST
1977
 4384  FF2BF8  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
1978
 4385  FF2BFC                		FDCINIT
1979
 4386  FF2BFC  02 30         		cop	$30
1980
 4387  FF2BFE  01            		.DB	$01
1981
 4388                        		.MNLIST
1982
 4389  FF2BFF  60            	?10:	rts
1983
 4390
1984
 4391                        	; # fdformat  drive flag/disk_fmt [fill = $00]
1985
  Tue Jul 17 11:00:24 2018                                                                                               Page   33
1986
 
1987
 
1988
 
1989
 
1990
 4392  FF2C00                	Cmd_fdformat:
1991
 4393  FF2C00  B0 E3         		bcs	CmdErr		; no parametri
1992
 4394  FF2C02  A5 BA         		lda	SMTmpL
1993
 4395  FF2C04  85 E2         		sta	SMTmp2		; drive
1994
 4396  FF2C06  20 5A 01      		jsr	GetParm		; parametro 2 - flag
1995
 4397  FF2C09  B0 DA         		bcs	CmdErr
1996
 4398  FF2C0B  A5 BA         		lda	SMTmpL
1997
 4399  FF2C0D  85 E3         		sta	SMTmp2+1	; flag
1998
 4400  FF2C0F  20 5A 01      		jsr	GetParm		; parametro 3 - fill byte
1999
 4401  FF2C12  90 02         		bcc	?04
2000
 4402  FF2C14  64 BA         		stz	SMTmpL		; default fill byte = $00
2001
 4403  FF2C16  A5 E2         	?04:	lda	SMTmp2
2002
 4404  FF2C18  48            		pha
2003
 4405  FF2C19  48            		pha			; drive
2004
 4406  FF2C1A  A5 E3         		lda	SMTmp2+1
2005
 4407  FF2C1C  48            		pha			; flag
2006
 4408  FF2C1D  A5 BA         		lda	SMTmpL
2007
 4409  FF2C1F  48            		pha			; fill byte
2008
 4410  FF2C20  4B            		phk			; bank of callback
2009
 4411  FF2C21  F4 63 2C      		pea	#_FmtNotify	; address of callback
2010
 4412  FF2C24                		FDCFORMAT
2011
 4413  FF2C24  02 33         		cop	$33
2012
 4414                        		.MNLIST
2013
 4415  FF2C26  68            		pla
2014
 4416  FF2C27  B0 93         		bcs	drs
2015
 4417  FF2C29                		SCNPRINT
2016
 4418  FF2C29  02 01         		cop	$01
2017
 4419                        		.MNLIST
2018
 4420  FF2C2B  0D 3A 3A 6D 61 		.DB	$0D, '::make file system', $00
2019
               6B 65 20 66 69
2020
               6C 65 20 73 79
2021
               73 74 65 6D 00
2022
 4421                        		;lda	SMTmp2
2023
 4422  FF2C3F  48            		pha			; drive
2024
 4423  FF2C40  A9 00         		lda	#0
2025
 4424  FF2C42  48            		pha			; buffer
2026
 4425  FF2C43  F4 00 00      		pea	#0		; ID
2027
 4426  FF2C46  48            		pha			; name = null
2028
 4427  FF2C47  F4 00 00      		pea	#0
2029
 4428  FF2C4A                		FDCMKFS
2030
 4429  FF2C4A  02 36         		cop	$36
2031
 4430                        		.MNLIST
2032
 4431  FF2C4C  4C BC 2B      		jmp	drs
2033
 4432  FF2C4F
2034
 4433
2035
 4434                        	; # fdverfmt  drive [default = 0]
2036
 4435  FF2C4F                	Cmd_fdverfmt:
2037
 4436  FF2C4F  F0 06         		beq	?01
2038
 4437  FF2C51  A5 BC         		lda	SMTmpK
2039
 4438  FF2C53  05 BB         		ora	SMTmpH
2040
 4439  FF2C55  D0 8E         		bne	CmdErr
2041
 4440  FF2C57  A5 BA         	?01:	lda	SMTmpL
2042
 4441  FF2C59  48            		pha			; drive
2043
 4442  FF2C5A  4B            		phk			; bank of callback
2044
 4443  FF2C5B  F4 EC 2C      		pea	#_VFmtNotify	; address of callback
2045
 4444  FF2C5E                		FDCVERFMT
2046
 4445  FF2C5E  02 34         		cop	$34
2047
  Tue Jul 17 11:00:24 2018                                                                                               Page   34
2048
 
2049
 
2050
 
2051
 
2052
 4446                        		.MNLIST
2053
 4447  FF2C60  4C 78 2B      		jmp	drs0
2054
 4448  FF2C63
2055
 4449                        	; funzione notify callback durante fdformat (LONG)
2056
 4450                        	; In	- A = drive
2057
 4451                        	;	  X = head
2058
 4452                        	;	  Y = track
2059
 4453                        	;	  B = sector/track
2060
 4454                        	;	  CF = 0 prima chiamata
2061
 4455  FF2C63                	_FmtNotify:
2062
 4456  FF2C63  0B            		phd
2063
 4457  FF2C64  F4 00 01      		pea	#DP01ADDR
2064
 4458  FF2C67  2B            		pld
2065
 4459  FF2C68  B0 68         		bcs	?10		; chiamate successive
2066
 4460  FF2C6A                		SCNPRINT
2067
 4461  FF2C6A  02 01         		cop	$01
2068
 4462                        		.MNLIST
2069
 4463  FF2C6C  0D 3A 3A 66 6F 		.DB	$0D, '::format diskette on drive #', $00
2070
               72 6D 61 74 20
2071
               64 69 73 6B 65
2072
               74 74 65 20 6F
2073
               6E 20 64 72 69
2074
               76 65 20 23 00
2075
 4464  FF2C8A  09 30         		ora	#'0'
2076
 4465  FF2C8C                		SCNCHAROUT
2077
 4466  FF2C8C  02 05         		cop	$05
2078
 4467                        		.MNLIST
2079
 4468  FF2C8E                		SCNPRINT
2080
 4469  FF2C8E  02 01         		cop	$01
2081
 4470                        		.MNLIST
2082
 4471  FF2C90  20 28 23 35 30 		.DB	' (#50T, #', $00
2083
               54 2C 20 23 00
2084
 4472  FF2C9A  EB            		xba			; A = sector/track
2085
 4473  FF2C9B  DA            		phx
2086
 4474  FF2C9C  5A            		phy
2087
 4475  FF2C9D  20 71 19      		jsr	PrintHex
2088
 4476  FF2CA0                		SCNPRINT
2089
 4477  FF2CA0  02 01         		cop	$01
2090
 4478                        		.MNLIST
2091
 4479  FF2CA2  53 2F 54 29 20 		.DB	'S/T) - Track: #', $00
2092
               2D 20 54 72 61
2093
               63 6B 3A 20 23
2094
               00
2095
 4480  FF2CB2                		SCNGETPOS
2096
 4481  FF2CB2  02 18         		cop	$18
2097
 4482  FF2CB4  02            		.DB	$02
2098
 4483                        		.MNLIST
2099
 4484  FF2CB5  86 D6         		stx	SMAuxL
2100
 4485  FF2CB7  84 D7         		sty	SMAuxH
2101
 4486  FF2CB9  68            		pla			; track
2102
 4487  FF2CBA  20 71 19      		jsr	PrintHex
2103
 4488  FF2CBD                		SCNPRINT
2104
 4489  FF2CBD  02 01         		cop	$01
2105
 4490                        		.MNLIST
2106
 4491  FF2CBF  2C 20 53 69 64 		.DB	', Side: #', $00
2107
               65 3A 20 23 00
2108
 4492  FF2CC9                		SCNGETPOS
2109
  Tue Jul 17 11:00:24 2018                                                                                               Page   35
2110
 
2111
 
2112
 
2113
 
2114
 4493  FF2CC9  02 18         		cop	$18
2115
 4494  FF2CCB  02            		.DB	$02
2116
 4495                        		.MNLIST
2117
 4496  FF2CCC  86 E2         		stx	SMTmp2
2118
 4497  FF2CCE  84 E3         		sty	SMTmp2+1
2119
 4498  FF2CD0  80 14         		bra	?20
2120
 4499  FF2CD2  DA            	?10:	phx
2121
 4500  FF2CD3  5A            		phy
2122
 4501  FF2CD4  A6 D6         		ldx	SMAuxL
2123
 4502  FF2CD6  A4 D7         		ldy	SMAuxH
2124
 4503  FF2CD8                		SCNSETPOS
2125
 4504  FF2CD8  02 18         		cop	$18
2126
 4505  FF2CDA  03            		.DB	$03
2127
 4506                        		.MNLIST
2128
 4507  FF2CDB  68            		pla
2129
 4508  FF2CDC  20 71 19      		jsr	PrintHex
2130
 4509  FF2CDF  A6 E2         		ldx	SMTmp2
2131
 4510  FF2CE1  A4 E3         		ldy	SMTmp2+1
2132
 4511  FF2CE3                		SCNSETPOS
2133
 4512  FF2CE3  02 18         		cop	$18
2134
 4513  FF2CE5  03            		.DB	$03
2135
 4514                        		.MNLIST
2136
 4515  FF2CE6  68            	?20:	pla
2137
 4516  FF2CE7  20 71 19      		jsr	PrintHex
2138
 4517  FF2CEA  2B            		pld
2139
 4518  FF2CEB  6B            		rtl
2140
 4519
2141
 4520                        	; funzione notify callback durante fdverfmt (LONG)
2142
 4521                        	; In	- A = drive
2143
 4522                        	;	  X = head
2144
 4523                        	;	  Y = track
2145
 4524                        	;	  B = format
2146
 4525                        	;	  CF = 0 prima chiamata
2147
 4526  FF2CEC                	_VFmtNotify:
2148
 4527  FF2CEC  0B            		phd
2149
 4528  FF2CED  F4 00 01      		pea	#DP01ADDR
2150
 4529  FF2CF0  2B            		pld
2151
 4530  FF2CF1  B0 71         		bcs	?10		; chiamate successive
2152
 4531  FF2CF3                		SCNPRINT
2153
 4532  FF2CF3  02 01         		cop	$01
2154
 4533                        		.MNLIST
2155
 4534  FF2CF5  0D 3A 3A 76 65 		.DB	$0D, '::verify format diskette on drive #', $00
2156
               72 69 66 79 20
2157
               66 6F 72 6D 61
2158
               74 20 64 69 73
2159
               6B 65 74 74 65
2160
               20 6F 6E 20 64
2161
               72 69 76 65 20
2162
               23 00
2163
 4535  FF2D1A  09 30         		ora	#'0'
2164
 4536  FF2D1C                		SCNCHAROUT
2165
 4537  FF2D1C  02 05         		cop	$05
2166
 4538                        		.MNLIST
2167
 4539  FF2D1E                		SCNPRINT
2168
 4540  FF2D1E  02 01         		cop	$01
2169
 4541                        		.MNLIST
2170
 4542  FF2D20  20 28 66 6F 72 		.DB	' (format #', $00
2171
  Tue Jul 17 11:00:24 2018                                                                                               Page   36
2172
 
2173
 
2174
 
2175
 
2176
               6D 61 74 20 23
2177
               00
2178
 4543  FF2D2B  EB            		xba			; A = format
2179
 4544  FF2D2C  DA            		phx
2180
 4545  FF2D2D  5A            		phy
2181
 4546  FF2D2E  20 71 19      		jsr	PrintHex
2182
 4547  FF2D31                		SCNPRINT
2183
 4548  FF2D31  02 01         		cop	$01
2184
 4549                        		.MNLIST
2185
 4550  FF2D33  29 20 2D 20 54 		.DB	') - Track: #', $00
2186
               72 61 63 6B 3A
2187
               20 23 00
2188
 4551  FF2D40                		SCNGETPOS
2189
 4552  FF2D40  02 18         		cop	$18
2190
 4553  FF2D42  02            		.DB	$02
2191
 4554                        		.MNLIST
2192
 4555  FF2D43  86 D6         		stx	SMAuxL
2193
 4556  FF2D45  84 D7         		sty	SMAuxH
2194
 4557  FF2D47  68            		pla			; track
2195
 4558  FF2D48  20 71 19      		jsr	PrintHex
2196
 4559  FF2D4B                		SCNPRINT
2197
 4560  FF2D4B  02 01         		cop	$01
2198
 4561                        		.MNLIST
2199
 4562  FF2D4D  2C 20 48 65 61 		.DB	', Head: #', $00
2200
               64 3A 20 23 00
2201
 4563  FF2D57                		SCNGETPOS
2202
 4564  FF2D57  02 18         		cop	$18
2203
 4565  FF2D59  02            		.DB	$02
2204
 4566                        		.MNLIST
2205
 4567  FF2D5A  86 E2         		stx	SMTmp2
2206
 4568  FF2D5C  84 E3         		sty	SMTmp2+1
2207
 4569  FF2D5E  68            		pla
2208
 4570  FF2D5F  20 71 19      		jsr	PrintHex
2209
 4571  FF2D62  2B            		pld
2210
 4572  FF2D63  6B            		rtl
2211
 4573  FF2D64  DA            	?10:	phx
2212
 4574  FF2D65  5A            		phy
2213
 4575  FF2D66  A6 D6         		ldx	SMAuxL
2214
 4576  FF2D68  A4 D7         		ldy	SMAuxH
2215
 4577  FF2D6A                		SCNSETPOS
2216
 4578  FF2D6A  02 18         		cop	$18
2217
 4579  FF2D6C  03            		.DB	$03
2218
 4580                        		.MNLIST
2219
 4581  FF2D6D  68            		pla
2220
 4582  FF2D6E  20 71 19      		jsr	PrintHex
2221
 4583  FF2D71  A6 E2         		ldx	SMTmp2
2222
 4584  FF2D73  A4 E3         		ldy	SMTmp2+1
2223
 4585  FF2D75                		SCNSETPOS
2224
 4586  FF2D75  02 18         		cop	$18
2225
 4587  FF2D77  03            		.DB	$03
2226
 4588                        		.MNLIST
2227
 4589  FF2D78  68            		pla
2228
 4590  FF2D79  20 71 19      		jsr	PrintHex
2229
 4591  FF2D7C  2B            		pld
2230
 4592  FF2D7D  6B            		rtl
2231
 4593
2232
 4594                        	; # fdtwrite drive [track=0 [buffer=0 [flag=0]]]
2233
  Tue Jul 17 11:00:24 2018                                                                                               Page   37
2234
 
2235
 
2236
 
2237
 
2238
 4595  FF2D7E                	Cmd_fdtwrite:
2239
 4596  FF2D7E  90 03         		bcc	?02
2240
 4597  FF2D80  4C 49 2F      		jmp	CmdErr3		; no parametri
2241
 4598  FF2D83  A2 02         	?02:	ldx	#2
2242
 4599  FF2D85  80 10         		bra	fdtrk
2243
 4600  FF2D87
2244
 4601                        	; # fdtread drive [track=0 [buffer=0 [flag=0]]]
2245
 4602  FF2D87                	Cmd_fdtread:
2246
 4603  FF2D87  90 03         		bcc	?02
2247
 4604  FF2D89  4C 49 2F      		jmp	CmdErr3		; no parametri
2248
 4605  FF2D8C  A2 00         	?02:	ldx	#0
2249
 4606  FF2D8E  80 07         		bra	fdtrk
2250
 4607
2251
 4608                        	; # fdtverf drive [track=0 [buffer=0 [flag=0]]]
2252
 4609  FF2D90                	Cmd_fdtverf:
2253
 4610  FF2D90  90 03         		bcc	?02
2254
 4611  FF2D92  4C 49 2F      		jmp	CmdErr3		; no parametri
2255
 4612  FF2D95  A2 01         	?02:	ldx	#1
2256
 4613
2257
 4614  FF2D97                	fdtrk:
2258
 4615  FF2D97  A5 BA         		lda	SMTmpL
2259
 4616  FF2D99  48            		pha			; drive
2260
 4617  FF2D9A  A9 00         		lda	#0
2261
 4618  FF2D9C  48            		pha			; track
2262
 4619  FF2D9D  48            		pha			; buffer
2263
 4620  FF2D9E  48            		pha			; flag
2264
 4621  FF2D9F  DA            		phx			; op
2265
 4622  FF2DA0  20 5A 01      		jsr	GetParm		; parametro 2 - track
2266
 4623  FF2DA3  B0 16         		bcs	?10
2267
 4624  FF2DA5  A5 BA         		lda	SMTmpL
2268
 4625  FF2DA7  83 04         		sta	$04,s		; track
2269
 4626  FF2DA9  20 5A 01      		jsr	GetParm		; parametro 3 - buffer
2270
 4627  FF2DAC  B0 0D         		bcs	?10
2271
 4628  FF2DAE  A5 BA         		lda	SMTmpL
2272
 4629  FF2DB0  83 03         		sta	$03,s		; buffer
2273
 4630  FF2DB2  20 5A 01      		jsr	GetParm		; parametro 4 - flag
2274
 4631  FF2DB5  B0 04         		bcs	?10
2275
 4632  FF2DB7  A5 BA         		lda	SMTmpL
2276
 4633  FF2DB9  83 02         		sta	$02,s		; flag
2277
 4634  FF2DBB  FA            	?10:	plx			; op
2278
 4635  FF2DBC  F0 0D         		beq	?30		; read
2279
 4636  FF2DBE  CA            		dex
2280
 4637  FF2DBF  F0 05         		beq	?20		; verf
2281
 4638  FF2DC1                		FDCTKWR
2282
 4639  FF2DC1  02 35         		cop	$35
2283
 4640  FF2DC3  02            		.DB	$02
2284
 4641                        		.MNLIST
2285
 4642  FF2DC4  80 2F         		bra	fdcr
2286
 4643  FF2DC6                	?20:	FDCTKVERF
2287
 4644  FF2DC6  02 35         		cop	$35
2288
 4645  FF2DC8  01            		.DB	$01
2289
 4646                        		.MNLIST
2290
 4647  FF2DC9  80 2A         		bra	fdcr
2291
 4648  FF2DCB                	?30:	FDCTKRD
2292
 4649  FF2DCB  02 35         		cop	$35
2293
 4650  FF2DCD  00            		.DB	$00
2294
 4651                        		.MNLIST
2295
  Tue Jul 17 11:00:24 2018                                                                                               Page   38
2296
 
2297
 
2298
 
2299
 
2300
 4652  FF2DCE  80 25         		bra	fdcr
2301
 4653  FF2DD0
2302
 4654                        	; # fdwrite drive [track=0 [head=0 [sect=1 [sectnum=1 [buffer=0 [flag=0]]]]]]
2303
 4655  FF2DD0                	Cmd_fdwrite:
2304
 4656  FF2DD0  90 03         		bcc	?02
2305
 4657  FF2DD2  4C 49 2F      		jmp	CmdErr3		; no parametri
2306
 4658  FF2DD5  20 47 2E      	?02:	jsr	GetFDCParm
2307
 4659  FF2DD8                		FDCWRITE
2308
 4660  FF2DD8  02 31         		cop	$31
2309
 4661  FF2DDA  02            		.DB	$02
2310
 4662                        		.MNLIST
2311
 4663  FF2DDB  80 18         		bra	fdcr
2312
 4664  FF2DDD
2313
 4665                        	; # fdverf drive [track=0 [head=0 [sect=1 [sectnum=1 [buffer=0 [flag=0]]]]]]
2314
 4666  FF2DDD                	Cmd_fdverf:
2315
 4667  FF2DDD  90 03         		bcc	?02
2316
 4668  FF2DDF  4C 49 2F      		jmp	CmdErr3		; no parametri
2317
 4669  FF2DE2  20 47 2E      	?02:	jsr	GetFDCParm
2318
 4670  FF2DE5                		FDCVERF
2319
 4671  FF2DE5  02 31         		cop	$31
2320
 4672  FF2DE7  01            		.DB	$01
2321
 4673                        		.MNLIST
2322
 4674  FF2DE8  80 0B         		bra	fdcr
2323
 4675
2324
 4676                        	; # fdread drive [track=0 [head=0 [sect=1 [sectnum=1 [buffer=0 [flag=0]]]]]]
2325
 4677  FF2DEA                	Cmd_fdread:
2326
 4678  FF2DEA  90 03         		bcc	?02
2327
 4679  FF2DEC  4C 49 2F      		jmp	CmdErr3		; no parametri
2328
 4680  FF2DEF  20 47 2E      	?02:	jsr	GetFDCParm
2329
 4681  FF2DF2                		FDCREAD
2330
 4682  FF2DF2  02 31         		cop	$31
2331
 4683  FF2DF4  00            		.DB	$00
2332
 4684                        		.MNLIST
2333
 4685  FF2DF5
2334
 4686  FF2DF5                	fdcr:
2335
 4687  FF2DF5  08            		php
2336
 4688  FF2DF6                		SCNPRINT	; clear result line
2337
 4689  FF2DF6  02 01         		cop	$01
2338
 4690                        		.MNLIST
2339
 4691  FF2DF8  0D 1B 71 00   		.DB	$0D, KB_ESC, 'q', $00
2340
 4692  FF2DFC  28            		plp
2341
 4693  FF2DFD  90 1B         		bcc	?02
2342
 4694  FF2DFF                		SCNPRINT
2343
 4695  FF2DFF  02 01         		cop	$01
2344
 4696                        		.MNLIST
2345
 4697  FF2E01  3A 3A 65 72 72 		.DB	'::error code -> ', $00
2346
               6F 72 20 63 6F
2347
               64 65 20 2D 3E
2348
               20 00
2349
 4698  FF2E12  48            		pha
2350
 4699  FF2E13  98            		tya
2351
 4700  FF2E14  20 4E 19      		jsr	PrintByte
2352
 4701  FF2E17  68            		pla
2353
 4702  FF2E18  80 09         		bra	?04
2354
 4703  FF2E1A                	?02:	SCNPRINT
2355
 4704  FF2E1A  02 01         		cop	$01
2356
 4705                        		.MNLIST
2357
  Tue Jul 17 11:00:24 2018                                                                                               Page   39
2358
 
2359
 
2360
 
2361
 
2362
 4706  FF2E1C  3A 3A 4F 4B 2C 		.DB	'::OK, ', $00
2363
               20 00
2364
 4707  FF2E23  9B            	?04:	txy
2365
 4708  FF2E24  EB            		xba
2366
 4709  FF2E25  AA            		tax
2367
 4710  FF2E26  EB            		xba
2368
 4711  FF2E27  20 48 19      		jsr	PrintWord
2369
 4712  FF2E2A  98            		tya
2370
 4713  FF2E2B                		SCNPRCHAR
2371
 4714  FF2E2B  02 07         		cop	$07
2372
 4715                        		.MNLIST
2373
 4716  FF2E2D  20            		.DB	' '
2374
 4717  FF2E2E  4C 71 19      		jmp	PrintHex
2375
 4718
2376
 4719                        	; # fdfs [drive = 0] {buffer = 0, ID = 0, name = NULL}
2377
 4720  FF2E31                	Cmd_fdfs:
2378
 4721  FF2E31  D0 02         		bne	?02
2379
 4722  FF2E33  64 BA         		stz	SMTmpL
2380
 4723  FF2E35  A5 BA         	?02:	lda	SMTmpL
2381
 4724  FF2E37  48            		pha			; drive
2382
 4725  FF2E38  A9 00         		lda	#$00
2383
 4726  FF2E3A  48            		pha			; buffer
2384
 4727  FF2E3B  F4 00 00      		pea	#0		; ID
2385
 4728  FF2E3E  48            		pha			; name = null
2386
 4729  FF2E3F  F4 00 00      		pea	#0
2387
 4730  FF2E42                		FDCMKFS
2388
 4731  FF2E42  02 36         		cop	$36
2389
 4732                        		.MNLIST
2390
 4733  FF2E44  4C BC 2B      		jmp	drs
2391
 4734
2392
 4735                        	; ricava parametri per funzioni fdread/fdwrite
2393
 4736  FF2E47                	GetFDCParm:
2394
 4737  FF2E47  FA            		plx			; return L
2395
 4738  FF2E48  68            		pla			; return H
2396
 4739  FF2E49  E8            		inx			; scarta stack - necessario per
2397
 4740  FF2E4A  D0 01         		bne	?01		; chiamare GetParm al giusto livello di stack
2398
 4741  FF2E4C  1A            		inc	a		; X,A -> indirizzo di ritorno
2399
 4742  FF2E4D  86 E2         	?01:	stx	SMTmp2
2400
 4743  FF2E4F  85 E3         		sta	SMTmp2+1
2401
 4744  FF2E51  A5 BA         		lda	SMTmpL		; drive
2402
 4745  FF2E53  48            		pha
2403
 4746  FF2E54  A9 00         		lda	#0		; default params
2404
 4747  FF2E56  48            		pha			; track = 0
2405
 4748  FF2E57  48            		pha			; head = 0
2406
 4749  FF2E58  A2 01         		ldx	#1
2407
 4750  FF2E5A  DA            		phx			; start sector = 1
2408
 4751  FF2E5B  DA            		phx			; sect. number = 1
2409
 4752  FF2E5C  48            		pha			; # buffer = 0
2410
 4753  FF2E5D  48            		pha			; flag = 0
2411
 4754  FF2E5E  20 5A 01      		jsr	GetParm		; parametro 2 - track
2412
 4755  FF2E61  B0 35         		bcs	?20
2413
 4756  FF2E63  A5 BA         		lda	SMTmpL
2414
 4757  FF2E65  83 06         		sta	$06,s		; track
2415
 4758  FF2E67  20 5A 01      		jsr	GetParm		; parametro 3 - head
2416
 4759  FF2E6A  B0 2C         		bcs	?20
2417
 4760  FF2E6C  A5 BA         		lda	SMTmpL
2418
 4761  FF2E6E  83 05         		sta	$05,s		; head
2419
  Tue Jul 17 11:00:24 2018                                                                                               Page   40
2420
 
2421
 
2422
 
2423
 
2424
 4762  FF2E70  20 5A 01      		jsr	GetParm		; parametro 4 - sector
2425
 4763  FF2E73  B0 23         		bcs	?20
2426
 4764  FF2E75  A5 BA         		lda	SMTmpL
2427
 4765  FF2E77  F0 02         		beq	?02
2428
 4766  FF2E79  83 04         		sta	$04,s		; sector
2429
 4767  FF2E7B  20 5A 01      	?02:	jsr	GetParm		; sector number
2430
 4768  FF2E7E  B0 18         		bcs	?20
2431
 4769  FF2E80  A5 BA         		lda	SMTmpL
2432
 4770  FF2E82  F0 02         		beq	?03
2433
 4771  FF2E84  83 03         		sta	$03,s		; sector number
2434
 4772  FF2E86  20 5A 01      	?03:	jsr	GetParm
2435
 4773  FF2E89  B0 0D         		bcs	?20
2436
 4774  FF2E8B  A5 BA         		lda	SMTmpL
2437
 4775  FF2E8D  83 02         		sta	$02,s		; buffer
2438
 4776  FF2E8F  20 5A 01      		jsr	GetParm
2439
 4777  FF2E92  B0 04         		bcs	?20
2440
 4778  FF2E94  A5 BA         		lda	SMTmpL
2441
 4779  FF2E96  83 01         		sta	$01,s		; flag
2442
 4780  FF2E98  6C E2 01      	?20:	jmp	(DP01ADDR+SMTmp2)	; return
2443
 4781
2444
 4782  FF2E9B
2445
 4783                        	;---------------------------------
2446
 4784  FF2E9B                	atacmd:
2447
 4785  FF2E9B  A5 E3         		lda	<atnum
2448
 4786  FF2E9D  0A            		asl	a
2449
 4787  FF2E9E  AA            		tax
2450
 4788  FF2E9F  7C A2 2E      		jmp	(ATACT,x)
2451
 4789  FF2EA2
2452
 4790  FF2EA2                	ATACT:
2453
 4791  FF2EA2  092F 012F 412F 		.DW	Cmd_atard, Cmd_ataverf, Cmd_atawr, Cmd_atares
2454
               F92E
2455
 4792  FF2EAA  E72E ED2E F32E 		.DW	Cmd_ataid, Cmd_atambr, Cmd_atapbr, Cmd_atadbuf
2456
               B82E
2457
 4793  FF2EB2  C62E D72E DF2E 		.DW	Cmd_atadbnk, Cmd_atadrd, Cmd_atadwr
2458
 4794
2459
 4795  FF2EB8                	Cmd_atadbuf:
2460
 4796  FF2EB8  A9 08         		lda	#$08		; PB3 VIA3
2461
 4797  FF2EBA  A6 BA         		ldx	SMTmpL
2462
 4798  FF2EBC  F0 04         		beq	?dis		; disable 1Mb buffer
2463
 4799  FF2EBE  1C C0 FD      		trb	VIA3+VIAPRB	; enable 1Mb buffer
2464
 4800  FF2EC1  60            		rts
2465
 4801  FF2EC2  0C C0 FD      	?dis:	tsb	VIA3+VIAPRB
2466
 4802  FF2EC5  60            		rts
2467
 4803
2468
 4804  FF2EC6                	Cmd_atadbnk:
2469
 4805  FF2EC6  A5 BA         		lda	SMTmpL
2470
 4806  FF2EC8  29 07         		and	#$07		; mask bank
2471
 4807  FF2ECA  85 BA         		sta	SMTmpL
2472
 4808  FF2ECC  AD CF FD      		lda	!VIA3+VIAPRANH
2473
 4809  FF2ECF  29 F8         		and	#$F8
2474
 4810  FF2ED1  05 BA         		ora	SMTmpL
2475
 4811  FF2ED3  8D CF FD      		sta	!VIA3+VIAPRANH	; set bank
2476
 4812  FF2ED6  60            		rts
2477
 4813
2478
 4814  FF2ED7                	Cmd_atadrd:
2479
 4815  FF2ED7  20 B8 2F      		jsr	GetATAParm2
2480
 4816  FF2EDA                		ATADMARD
2481
  Tue Jul 17 11:00:24 2018                                                                                               Page   41
2482
 
2483
 
2484
 
2485
 
2486
 4817  FF2EDA  02 42         		cop	$42
2487
 4818  FF2EDC  00            		.DB	$00
2488
 4819                        		.MNLIST
2489
 4820  FF2EDD  80 30         		bra	ATAClean
2490
 4821
2491
 4822  FF2EDF                	Cmd_atadwr:
2492
 4823  FF2EDF  20 B8 2F      		jsr	GetATAParm2
2493
 4824  FF2EE2                		ATADMAWR
2494
 4825  FF2EE2  02 42         		cop	$42
2495
 4826  FF2EE4  01            		.DB	$01
2496
 4827                        		.MNLIST
2497
 4828  FF2EE5  80 28         		bra	ATAClean
2498
 4829
2499
 4830  FF2EE7                	Cmd_ataid:
2500
 4831  FF2EE7  A6 BA         		ldx	SMTmpL
2501
 4832  FF2EE9  A9 01         		lda	#1
2502
 4833  FF2EEB  80 10         		bra	atactl
2503
 4834
2504
 4835  FF2EED                	Cmd_atambr:
2505
 4836  FF2EED  A6 BA         		ldx	SMTmpL
2506
 4837  FF2EEF  A9 02         		lda	#2
2507
 4838  FF2EF1  80 0A         		bra	atactl
2508
 4839
2509
 4840  FF2EF3                	Cmd_atapbr:
2510
 4841  FF2EF3  A6 BA         		ldx	SMTmpL
2511
 4842  FF2EF5  A9 03         		lda	#3
2512
 4843  FF2EF7  80 04         		bra	atactl
2513
 4844
2514
 4845  FF2EF9                	Cmd_atares:
2515
 4846  FF2EF9  A6 BA         		ldx	SMTmpL
2516
 4847  FF2EFB  A9 00         		lda	#0
2517
 4848  FF2EFD                	atactl:
2518
 4849  FF2EFD                		ATACTL
2519
 4850  FF2EFD  02 41         		cop	$41
2520
 4851                        		.MNLIST
2521
 4852  FF2EFF  80 0E         		bra	ATAClean
2522
 4853  FF2F01
2523
 4854                        	; test lettura device ATA
2524
 4855                        	; atard <80 (flag verifica)> + device <LBA=0> <NUMSECT=64> <BUFFER=030000>
2525
 4856  FF2F01                	Cmd_ataverf:
2526
 4857  FF2F01  20 4C 2F      		jsr	GetATAParm
2527
 4858  FF2F04                		ATAVERF
2528
 4859  FF2F04  02 40         		cop	$40
2529
 4860  FF2F06  01            		.DB	$01
2530
 4861                        		.MNLIST
2531
 4862  FF2F07  80 06         		bra	ATAClean
2532
 4863  FF2F09
2533
 4864  FF2F09                	Cmd_atard:
2534
 4865  FF2F09  20 4C 2F      		jsr	GetATAParm
2535
 4866  FF2F0C                		ATAREAD
2536
 4867  FF2F0C  02 40         		cop	$40
2537
 4868  FF2F0E  00            		.DB	$00
2538
 4869                        		.MNLIST
2539
 4870
2540
 4871  FF2F0F                	ATAClean:
2541
 4872  FF2F0F  B0 14         		bcs	?02
2542
 4873  FF2F11                		SCNPRINT
2543
  Tue Jul 17 11:00:24 2018                                                                                               Page   42
2544
 
2545
 
2546
 
2547
 
2548
 4874  FF2F11  02 01         		cop	$01
2549
 4875                        		.MNLIST
2550
 4876  FF2F13  0D 3A 3A 4F 4B 		.DB	$0D, '::OK - no error', $00
2551
               20 2D 20 6E 6F
2552
               20 65 72 72 6F
2553
               72 00
2554
 4877  FF2F24  60            		rts
2555
 4878  FF2F25                	?02:	SCNPRINT
2556
 4879  FF2F25  02 01         		cop	$01
2557
 4880                        		.MNLIST
2558
 4881  FF2F27  0D 3A 3A 65 72 		.DB	$0D, '::error code -> ', $00
2559
               72 6F 72 20 63
2560
               6F 64 65 20 2D
2561
               3E 20 00
2562
 4882  FF2F39  98            		tya
2563
 4883  FF2F3A  20 4E 19      		jsr	PrintByte
2564
 4884  FF2F3D  8A            		txa
2565
 4885  FF2F3E  4C 71 19      		jmp	PrintHex
2566
 4886
2567
 4887                        	; test scrittura su device ATA
2568
 4888                        	; atawrite <80 (flag verifica)> + device <LBA=0> <NUMSECT=64> <BUFFER=0>
2569
 4889  FF2F41                	Cmd_atawr:
2570
 4890  FF2F41  20 4C 2F      		jsr	GetATAParm
2571
 4891  FF2F44                		ATAWRITE
2572
 4892  FF2F44  02 40         		cop	$40
2573
 4893  FF2F46  02            		.DB	$02
2574
 4894                        		.MNLIST
2575
 4895  FF2F47  80 C6         		bra	ATAClean
2576
 4896
2577
 4897  FF2F49                	CmdErr3:
2578
 4898  FF2F49  4C 34 01      		jmp	ErrCls2
2579
 4899
2580
 4900                        	; ricava parametri per funzioni ATA read/write
2581
 4901  FF2F4C                	GetATAParm:
2582
 4902  FF2F4C  FA            		plx			; return L
2583
 4903  FF2F4D  68            		pla			; return H
2584
 4904  FF2F4E  E8            		inx			; scarta stack - necessario per
2585
 4905  FF2F4F  D0 01         		bne	?01		; chiamare GetParm al giusto livello di stack
2586
 4906  FF2F51  1A            		inc	a		; X,A -> indirizzo di ritorno
2587
 4907  FF2F52  86 E2         	?01:	stx	SMTmp2
2588
 4908  FF2F54  85 E3         		sta	SMTmp2+1
2589
 4909  FF2F56                		ACC16
2590
 4910  FF2F56  C2 20         		rep	#PMFLAG
2591
 4911                        		.LONGA	on
2592
 4912                        		.MNLIST
2593
 4913  FF2F58  3B            		tsc			; stack frame
2594
 4914  FF2F59  38            		sec
2595
 4915  FF2F5A  E9 09 00      		sbc	#9		; crea parametri stack
2596
 4916  FF2F5D  1B            		tcs
2597
 4917  FF2F5E  1A            		inc	a
2598
 4918  FF2F5F  85 BE         		sta	SMSizeL		; salva stack frame
2599
 4919  FF2F61                		ACC08
2600
 4920  FF2F61  E2 20         		sep	#PMFLAG
2601
 4921                        		.LONGA	off
2602
 4922                        		.MNLIST
2603
 4923  FF2F63  A5 BA         		lda	SMTmpL		; parametro 1 - device + flag verifica
2604
 4924  FF2F65  AA            		tax
2605
  Tue Jul 17 11:00:24 2018                                                                                               Page   43
2606
 
2607
 
2608
 
2609
 
2610
 4925  FF2F66  29 01         		and	#$01		; maschera device
2611
 4926  FF2F68  83 09         		sta	$09,s		; device
2612
 4927  FF2F6A  8A            		txa
2613
 4928  FF2F6B  29 80         		and	#$80		; maschera flag
2614
 4929  FF2F6D  83 01         		sta	$01,s		; flag
2615
 4930  FF2F6F  A9 00         		lda	#0
2616
 4931  FF2F71  83 02         		sta	$02,s		; lpBuf default=$030000
2617
 4932  FF2F73  83 03         		sta	$03,s
2618
 4933  FF2F75  A9 03         		lda	#3
2619
 4934  FF2F77  83 04         		sta	$04,s
2620
 4935  FF2F79  A9 40         		lda	#64		; numero settori di default (64)
2621
 4936  FF2F7B  83 05         		sta	$05,s
2622
 4937  FF2F7D  A9 00         		lda	#0
2623
 4938  FF2F7F  83 06         		sta	$06,s		; LBA di default (0)
2624
 4939  FF2F81  83 07         		sta	$07,s
2625
 4940  FF2F83  83 08         		sta	$08,s
2626
 4941  FF2F85  20 52 01      		jsr	GetParm32	; parametro 2 - LBA
2627
 4942  FF2F88  B0 26         		bcs	?18		; fine - OK
2628
 4943  FF2F8A  A5 BA         		lda	SMTmpL
2629
 4944  FF2F8C  83 06         		sta	$06,s
2630
 4945  FF2F8E  A5 BB         		lda	SMTmpH
2631
 4946  FF2F90  83 07         		sta	$07,s
2632
 4947  FF2F92  A5 BC         		lda	SMTmpK
2633
 4948  FF2F94  83 08         		sta	$08,s
2634
 4949  FF2F96  20 5A 01      		jsr	GetParm		; parametro 3 - numero settori
2635
 4950  FF2F99  B0 15         		bcs	?18		; fine - OK
2636
 4951  FF2F9B  A5 BA         		lda	SMTmpL
2637
 4952  FF2F9D  83 05         		sta	$05,s
2638
 4953  FF2F9F  20 5A 01      		jsr	GetParm		; parametro 4 - buffer
2639
 4954  FF2FA2  B0 0C         		bcs	?18		; fine - OK
2640
 4955  FF2FA4  A5 BA         		lda	SMTmpL
2641
 4956  FF2FA6  83 02         		sta	$02,s
2642
 4957  FF2FA8  A5 BB         		lda	SMTmpH
2643
 4958  FF2FAA  83 03         		sta	$03,s
2644
 4959  FF2FAC  A5 BC         		lda	SMTmpK
2645
 4960                        		;lda	#0
2646
 4961  FF2FAE  83 04         		sta	$04,s
2647
 4962  FF2FB0  A5 BF         	?18:	lda	SMSizeH		; C = stack frame
2648
 4963  FF2FB2  EB            		xba
2649
 4964  FF2FB3  A5 BE         		lda	SMSizeL
2650
 4965  FF2FB5  6C E2 01      		jmp	(DP01ADDR+SMTmp2)	; return
2651
 4966
2652
 4967                        	; ricava parametri per funzioni ATA DMA read/write
2653
 4968  FF2FB8                	GetATAParm2:
2654
 4969  FF2FB8  FA            		plx			; return L
2655
 4970  FF2FB9  68            		pla			; return H
2656
 4971  FF2FBA  E8            		inx			; scarta stack - necessario per
2657
 4972  FF2FBB  D0 01         		bne	?01		; chiamare GetParm al giusto livello di stack
2658
 4973  FF2FBD  1A            		inc	a		; X,A -> indirizzo di ritorno
2659
 4974  FF2FBE  86 E2         	?01:	stx	SMTmp2
2660
 4975  FF2FC0  85 E3         		sta	SMTmp2+1
2661
 4976  FF2FC2                		ACC16
2662
 4977  FF2FC2  C2 20         		rep	#PMFLAG
2663
 4978                        		.LONGA	on
2664
 4979                        		.MNLIST
2665
 4980  FF2FC4  3B            		tsc			; stack frame
2666
 4981  FF2FC5  38            		sec
2667
  Tue Jul 17 11:00:24 2018                                                                                               Page   44
2668
 
2669
 
2670
 
2671
 
2672
 4982  FF2FC6  E9 07 00      		sbc	#7		; crea parametri stack
2673
 4983  FF2FC9  1B            		tcs
2674
 4984  FF2FCA  1A            		inc	a
2675
 4985  FF2FCB  85 BE         		sta	SMSizeL		; salva stack frame
2676
 4986  FF2FCD                		ACC08
2677
 4987  FF2FCD  E2 20         		sep	#PMFLAG
2678
 4988                        		.LONGA	off
2679
 4989                        		.MNLIST
2680
 4990  FF2FCF  A5 BA         		lda	SMTmpL		; parametro 1 - device
2681
 4991  FF2FD1  29 01         		and	#$01		; maschera device
2682
 4992  FF2FD3  83 07         		sta	$07,s		; device
2683
 4993  FF2FD5  A9 00         		lda	#0
2684
 4994  FF2FD7  83 01         		sta	$01,s		; nBuf default=$0000
2685
 4995  FF2FD9  83 02         		sta	$02,s
2686
 4996  FF2FDB  A9 40         		lda	#64		; numero settori di default (64)
2687
 4997  FF2FDD  83 03         		sta	$03,s
2688
 4998  FF2FDF  A9 00         		lda	#0
2689
 4999  FF2FE1  83 04         		sta	$04,s		; LBA di default (0)
2690
 5000  FF2FE3  83 05         		sta	$05,s
2691
 5001  FF2FE5  83 06         		sta	$06,s
2692
 5002  FF2FE7  20 52 01      		jsr	GetParm32	; parametro 2 - LBA
2693
 5003  FF2FEA  B0 22         		bcs	?18		; fine - OK
2694
 5004  FF2FEC  A5 BA         		lda	SMTmpL
2695
 5005  FF2FEE  83 04         		sta	$04,s
2696
 5006  FF2FF0  A5 BB         		lda	SMTmpH
2697
 5007  FF2FF2  83 05         		sta	$05,s
2698
 5008  FF2FF4  A5 BC         		lda	SMTmpK
2699
 5009  FF2FF6  83 06         		sta	$06,s
2700
 5010  FF2FF8  20 5A 01      		jsr	GetParm		; parametro 3 - numero settori
2701
 5011  FF2FFB  B0 11         		bcs	?18		; fine - OK
2702
 5012  FF2FFD  A5 BA         		lda	SMTmpL
2703
 5013  FF2FFF  83 03         		sta	$03,s
2704
 5014  FF3001  20 5A 01      		jsr	GetParm		; parametro 4 - buffer
2705
 5015  FF3004  B0 08         		bcs	?18		; fine - OK
2706
 5016  FF3006  A5 BA         		lda	SMTmpL
2707
 5017  FF3008  83 01         		sta	$01,s
2708
 5018  FF300A  A5 BB         		lda	SMTmpH
2709
 5019  FF300C  83 02         		sta	$02,s
2710
 5020  FF300E  A5 BF         	?18:	lda	SMSizeH		; C = stack frame
2711
 5021  FF3010  EB            		xba
2712
 5022  FF3011  A5 BE         		lda	SMSizeL
2713
 5023  FF3013  6C E2 01      		jmp	(DP01ADDR+SMTmp2)	; return
2714
 5024
2715
 5025                        	; #sptest -p<port> -b -h<handshake> -r -e -t -u
2716
 5026                        	; -p: port 0 or 1 (default: 0)
2717
 5027                        	; -b: baud rate = 19,200 (default: 38,400)
2718
 5028                        	; -h: handshke level = 0,1,2 (defalt: 2)
2719
 5029                        	;	0=none, 1=software, 2=hardware
2720
 5030                        	; -r: RS485 (default: RS232)
2721
 5031                        	; -e: enable echo in rx mode (default mode: rx)
2722
 5032                        	; -t: enable tx mode (-e ignored)
2723
 5033                        	; -u: RS232 uplink (RS485 term.)
2724
 5034  FF3016                	Cmd_sptst:
2725
 5035                        		.EXTERN lspset, lspget, lspput, lspres
2726
 5036                        		.PUBLIC Cmd_sptst
2727
 5037
2728
 5038  FF3016                		SCN_CR
2729
  Tue Jul 17 11:00:24 2018                                                                                               Page   45
2730
 
2731
 
2732
 
2733
 
2734
 5039  FF3016                		SCNPRCHAR
2735
 5040                        		.MLIST
2736
 5041  FF3016  02 07         		cop	$07
2737
 5042                        		.MNLIST
2738
 5043  FF3018  0D            		.DB	$0D
2739
 5044                        		.MNLIST
2740
 5045  FF3019  64 E2         		stz	SMTmp2		; port 0
2741
 5046  FF301B  64 E5         		stz	SMTmp2+3	; no echo, rx mode
2742
 5047  FF301D  A9 02         		lda	#2
2743
 5048  FF301F  85 E3         		sta	SMTmp2+1	; hardware handshake
2744
 5049  FF3021  A9 D4         		lda	#11010100B
2745
 5050  FF3023  85 E4         		sta	SMTmp2+2
2746
 5051  FF3025  A9 80         		lda	#$80		; flag
2747
 5052  FF3027  48            		pha
2748
 5053  FF3028  A6 E0         		ldx	cmdlin
2749
 5054  FF302A                		ACC16CLC
2750
 5055  FF302A  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
2751
 5056                        		.LONGA	on
2752
 5057                        		.MNLIST
2753
 5058  FF302C  8A            		txa
2754
 5059  FF302D  69 00 99      		adc	#INPUTBUF
2755
 5060  FF3030  A2 01         		ldx	#^INPUTBUF
2756
 5061  FF3032  DA            		phx			; command line
2757
 5062  FF3033  48            		pha
2758
 5063  FF3034                		ACC08
2759
 5064  FF3034  E2 20         		sep	#PMFLAG
2760
 5065                        		.LONGA	off
2761
 5066                        		.MNLIST
2762
 5067  FF3036  4B            		phk			; option string
2763
 5068  FF3037  F4 76 31      		pea	#!?100
2764
 5069  FF303A  F4 00 00      		pea	#0		; result
2765
 5070  FF303D  F4 00 00      		pea	#0
2766
 5071  FF3040  22 09 00 FA   	?10:	jsl	_getopt		; get opttion's loop
2767
 5072  FF3044  B0 56         		bcs	?26		; error
2768
 5073  FF3046  AA            		tax			; option char
2769
 5074  FF3047  F0 53         		beq	?26		; end of command line
2770
 5075  FF3049  30 50         		bmi	?24		; no option argument
2771
 5076  FF304B  C9 70         		cmp	#'p'
2772
 5077  FF304D  D0 08         		bne	?12
2773
 5078  FF304F  A3 01         		lda	$01,s
2774
 5079  FF3051  29 01         		and	#1
2775
 5080  FF3053  85 E2         		sta	SMTmp2		; port
2776
 5081  FF3055  80 E9         		bra	?10
2777
 5082  FF3057  C9 68         	?12:	cmp	#'h'
2778
 5083  FF3059  D0 0E         		bne	?14
2779
 5084  FF305B  A3 01         		lda	$01,s
2780
 5085  FF305D  29 03         		and	#3
2781
 5086  FF305F  C9 03         		cmp	#3
2782
 5087  FF3061  90 02         		bcc	?13
2783
 5088  FF3063  A9 02         		lda	#2
2784
 5089  FF3065  85 E3         	?13:	sta	SMTmp2+1	; handshake
2785
 5090  FF3067  80 D7         		bra	?10
2786
 5091  FF3069  C9 62         	?14:	cmp	#'b'
2787
 5092  FF306B  D0 06         		bne	?16
2788
 5093  FF306D  A9 10         		lda	#$10
2789
 5094  FF306F  14 E4         		trb	SMTmp2+2	; 19200
2790
 5095  FF3071  80 CD         		bra	?10
2791
  Tue Jul 17 11:00:24 2018                                                                                               Page   46
2792
 
2793
 
2794
 
2795
 
2796
 5096  FF3073  C9 72         	?16:	cmp	#'r'
2797
 5097  FF3075  D0 06         		bne	?18
2798
 5098  FF3077  A9 02         		lda	#$02
2799
 5099  FF3079  04 E4         		tsb	SMTmp2+2	; RS485
2800
 5100  FF307B  80 C3         		bra	?10
2801
 5101  FF307D  C9 75         	?18:	cmp	#'u'
2802
 5102  FF307F  D0 06         		bne	?20
2803
 5103  FF3081  A9 01         		lda	#$01
2804
 5104  FF3083  04 E4         		tsb	SMTmp2+2	; RS485 term/RS232 uplink cable
2805
 5105  FF3085  80 B9         		bra	?10
2806
 5106  FF3087  C9 65         	?20:	cmp	#'e'
2807
 5107  FF3089  D0 06         		bne	?22
2808
 5108  FF308B  A9 80         		lda	#$80
2809
 5109  FF308D  04 E5         		tsb	SMTmp2+3	; rx+echo mode
2810
 5110  FF308F  80 AF         		bra	?10
2811
 5111  FF3091  C9 74         	?22:	cmp	#'t'
2812
 5112  FF3093  D0 06         		bne	?24
2813
 5113  FF3095  A9 40         		lda	#$40
2814
 5114  FF3097  04 E5         		tsb	SMTmp2+3	; tx mode
2815
 5115  FF3099  80 A5         		bra	?10
2816
 5116  FF309B  38            	?24:	sec
2817
 5117  FF309C  08            	?26:	php			; clean stack
2818
 5118  FF309D  FA            		plx			; save carry
2819
 5119  FF309E                		ACC16CLC
2820
 5120  FF309E  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
2821
 5121                        		.LONGA	on
2822
 5122                        		.MNLIST
2823
 5123  FF30A0  3B            		tsc
2824
 5124  FF30A1  69 0B 00      		adc	#11
2825
 5125  FF30A4  1B            		tcs
2826
 5126  FF30A5                		ACC08
2827
 5127  FF30A5  E2 20         		sep	#PMFLAG
2828
 5128                        		.LONGA	off
2829
 5129                        		.MNLIST
2830
 5130  FF30A7  8A            		txa
2831
 5131  FF30A8  4A            		lsr	a		; test carry
2832
 5132  FF30A9  90 03         		bcc	?28		; ok
2833
 5133  FF30AB  4C 34 01      		jmp	ErrCls2
2834
 5134  FF30AE  A5 E3         	?28:	lda	SMTmp2+1
2835
 5135  FF30B0  D0 06         		bne	?30
2836
 5136  FF30B2  A9 C0         		lda	#$C0
2837
 5137  FF30B4  14 E4         		trb	SMTmp2+2
2838
 5138  FF30B6  80 12         		bra	?34
2839
 5139  FF30B8  C9 01         	?30:	cmp	#1
2840
 5140  FF30BA  D0 0A         		bne	?32
2841
 5141  FF30BC  A9 C0         		lda	#$C0
2842
 5142  FF30BE  14 E4         		trb	SMTmp2+2
2843
 5143  FF30C0  A9 80         		lda	#$80
2844
 5144  FF30C2  04 E4         		tsb	SMTmp2+2
2845
 5145  FF30C4  80 04         		bra	?34
2846
 5146  FF30C6  A9 C0         	?32:	lda	#$C0
2847
 5147  FF30C8  04 E4         		tsb	SMTmp2+2
2848
 5148  FF30CA  A6 E2         	?34:	ldx	SMTmp2		; X=port
2849
 5149  FF30CC  A5 E4         		lda	SMTmp2+2	; A=mode
2850
 5150  FF30CE  22 06 08 F8   		jsl	lspset
2851
 5151  FF30D2  A5 E2         		lda	SMTmp2
2852
 5152  FF30D4  0A            		asl	a
2853
  Tue Jul 17 11:00:24 2018                                                                                               Page   47
2854
 
2855
 
2856
 
2857
 
2858
 5153  FF30D5  0A            		asl	a
2859
 5154  FF30D6  85 E3         		sta	SMTmp2+1
2860
 5155  FF30D8  3B            		tsc
2861
 5156  FF30D9  85 E6         		sta	SMTmp2+4
2862
 5157  FF30DB  EB            		xba
2863
 5158  FF30DC  85 E7         		sta	SMTmp2+5
2864
 5159  FF30DE  24 E5         		bit	SMTmp2+3	; check tx/rx mode
2865
 5160  FF30E0  70 03         		bvs	?40		; tx mode
2866
 5161  FF30E2  4C 85 31      		jmp	?300
2867
 5162  FF30E5
2868
 5163  FF30E5  64 BA         	?40:	stz	SMTmpL
2869
 5164  FF30E7  64 BB         		stz	SMTmpH
2870
 5165  FF30E9  A6 E3         	?41:	ldx	SMTmp2+1
2871
 5166  FF30EB  3C 56 00      		bit	!splin,x
2872
 5167  FF30EE  10 07         		bpl	?42		; on line
2873
 5168  FF30F0  20 80 1A      		jsr	CkStop
2874
 5169  FF30F3  D0 F4         		bne	?41
2875
 5170  FF30F5  F0 47         		beq	?90		; stop
2876
 5171  FF30F7  A9 0D         	?42:	lda	#$0D
2877
 5172  FF30F9  20 56 31      		jsr	?200
2878
 5173  FF30FC  20 80 1A      	?45:	jsr	CkStop		; loop TX
2879
 5174  FF30FF  F0 3D         		beq	?90		; stop
2880
 5175  FF3101  A5 BB         		lda	SMTmpH
2881
 5176  FF3103  20 7C 19      		jsr	FF_Byte2Hex
2882
 5177  FF3106  DA            		phx
2883
 5178  FF3107  20 56 31      		jsr	?200		; send
2884
 5179  FF310A  68            		pla
2885
 5180  FF310B  20 56 31      		jsr	?200		; send
2886
 5181  FF310E  A5 BA         		lda	SMTmpL
2887
 5182  FF3110  20 7C 19      		jsr	FF_Byte2Hex
2888
 5183  FF3113  DA            		phx
2889
 5184  FF3114  20 56 31      		jsr	?200
2890
 5185  FF3117  68            		pla
2891
 5186  FF3118  20 56 31      		jsr	?200
2892
 5187  FF311B  A9 20         		lda	#' '
2893
 5188  FF311D  20 56 31      		jsr	?200
2894
 5189  FF3120  A9 40         		lda	#$40
2895
 5190  FF3122  85 BC         		sta	SMTmpK
2896
 5191  FF3124  A5 BC         	?47:	lda	SMTmpK
2897
 5192  FF3126  20 56 31      		jsr	?200
2898
 5193  FF3129  E6 BC         		inc	SMTmpK
2899
 5194  FF312B  A5 BC         		lda	SMTmpK
2900
 5195  FF312D  C9 7E         		cmp	#$7E
2901
 5196  FF312F  90 F3         		bcc	?47
2902
 5197  FF3131  A9 0D         		lda	#$0D
2903
 5198  FF3133  20 56 31      		jsr	?200
2904
 5199  FF3136                		ACC16
2905
 5200  FF3136  C2 20         		rep	#PMFLAG
2906
 5201                        		.LONGA	on
2907
 5202                        		.MNLIST
2908
 5203  FF3138  E6 BA         		inc	SMTmpL
2909
 5204  FF313A                		ACC08
2910
 5205  FF313A  E2 20         		sep	#PMFLAG
2911
 5206                        		.LONGA	off
2912
 5207                        		.MNLIST
2913
 5208  FF313C  80 BE         		bra	?45
2914
 5209  FF313E
2915
  Tue Jul 17 11:00:24 2018                                                                                               Page   48
2916
 
2917
 
2918
 
2919
 
2920
 5210  FF313E  A9 FF         	?90:	lda	#$FF		; stop: CTRL BREAK
2921
 5211  FF3140                	?91:	SCN_CR
2922
 5212  FF3140                		SCNPRCHAR
2923
 5213                        		.MLIST
2924
 5214  FF3140  02 07         		cop	$07
2925
 5215                        		.MNLIST
2926
 5216  FF3142  0D            		.DB	$0D
2927
 5217                        		.MNLIST
2928
 5218  FF3143  20 4E 19      		jsr	PrintByte
2929
 5219  FF3146                		SCN_CR
2930
 5220  FF3146                		SCNPRCHAR
2931
 5221                        		.MLIST
2932
 5222  FF3146  02 07         		cop	$07
2933
 5223                        		.MNLIST
2934
 5224  FF3148  0D            		.DB	$0D
2935
 5225                        		.MNLIST
2936
 5226  FF3149  A6 E2         	?99:	ldx	SMTmp2
2937
 5227  FF314B  22 16 08 F8   		jsl	lspres
2938
 5228  FF314F  A5 E7         		lda	SMTmp2+5
2939
 5229  FF3151  EB            		xba
2940
 5230  FF3152  A5 E6         		lda	SMTmp2+4
2941
 5231  FF3154  1B            		tcs
2942
 5232  FF3155  60            		rts
2943
 5233  FF3156
2944
 5234  FF3156  A6 E2         	?200:	ldx	SMTmp2
2945
 5235  FF3158  22 F6 07 F8   	?210:	jsl	lspput
2946
 5236  FF315C  90 07         		bcc	?215
2947
 5237  FF315E  C8            		iny
2948
 5238  FF315F  D0 F7         		bne	?210
2949
 5239  FF3161  A9 80         		lda	#$80		; remote off-line
2950
 5240  FF3163  80 DB         		bra	?91
2951
 5241  FF3165
2952
 5242  FF3165  24 E5         	?215:	bit	SMTmp2+3
2953
 5243  FF3167  10 0C         		bpl	?250
2954
 5244  FF3169  22 E6 07 F8   		jsl	lspget
2955
 5245  FF316D  B0 03         		bcs	?220
2956
 5246  FF316F                		TXTCHAROUT
2957
 5247  FF316F  02 06         		cop	$06
2958
 5248                        		.MNLIST
2959
 5249  FF3171  60            		rts
2960
 5250  FF3172  A8            	?220:	tay
2961
 5251  FF3173  D0 CB         		bne	?91
2962
 5252  FF3175  60            	?250:	rts
2963
 5253
2964
 5254  FF3176
2965
 5255  FF3176  70 25 62 20 68 	?100:	.DB	'p%b h%r e t u ', 0
2966
               25 72 20 65 20
2967
               74 20 75 20 00
2968
 5256
2969
 5257  FF3185  A9 30         	?300:	lda	#'0'
2970
 5258  FF3187  8D 00 20      		sta	!$2000
2971
 5259  FF318A  8D 01 20      		sta	!$2001
2972
 5260  FF318D  8D 02 20      		sta	!$2002
2973
 5261  FF3190  8D 03 20      		sta	!$2003
2974
 5262  FF3193  A9 20         		lda	#' '
2975
 5263  FF3195  8D 04 20      		sta	!$2004
2976
 5264  FF3198  A9 40         		lda	#$40
2977
  Tue Jul 17 11:00:24 2018                                                                                               Page   49
2978
 
2979
 
2980
 
2981
 
2982
 5265  FF319A  A2 00         		ldx	#0
2983
 5266  FF319C  9D 05 20      	?300l:	sta	!$2005,x
2984
 5267  FF319F  E8            		inx
2985
 5268  FF31A0  1A            		inc	a
2986
 5269  FF31A1  C9 7E         		cmp	#$7E
2987
 5270  FF31A3  90 F7         		bcc	?300l
2988
 5271  FF31A5  9E 05 20      		stz	!$2005,x
2989
 5272  FF31A8  64 BA         	?300w:	stz	SMTmpL
2990
 5273  FF31AA  64 BB         		stz	SMTmpH
2991
 5274  FF31AC  64 BC         		stz	SMTmpK
2992
 5275  FF31AE  A6 E3         		ldx	SMTmp2+1
2993
 5276  FF31B0  3C 56 00      		bit	!splin,x
2994
 5277  FF31B3  10 07         		bpl	?320		; on line
2995
 5278  FF31B5  20 80 1A      		jsr	CkStop
2996
 5279  FF31B8  D0 EE         		bne	?300w
2997
 5280  FF31BA  F0 76         		beq	?340
2998
 5281  FF31BC  A5 BC         	?320:	lda	SMTmpK
2999
 5282  FF31BE  D0 16         		bne	?320z
3000
 5283
3001
 5284  FF31C0  A5 BB         		lda	SMTmpH
3002
 5285  FF31C2  20 7C 19      		jsr	FF_Byte2Hex
3003
 5286  FF31C5  8D 00 20      		sta	!$2000
3004
 5287  FF31C8  8E 01 20      		stx	.ABS.$2001
3005
 5288  FF31CB  A5 BA         		lda	SMTmpL
3006
 5289  FF31CD  20 7C 19      		jsr	FF_Byte2Hex
3007
 5290  FF31D0  8D 02 20      		sta	!$2002
3008
 5291  FF31D3  8E 03 20      		stx	.ABS.$2003
3009
 5292  FF31D6
3010
 5293  FF31D6  20 80 1A      	?320z:	jsr	CkStop
3011
 5294  FF31D9  F0 57         		beq	?340
3012
 5295  FF31DB  A6 E2         		ldx	SMTmp2
3013
 5296  FF31DD  22 E6 07 F8   		jsl	lspget
3014
 5297  FF31E1  B0 4A         		bcs	?330
3015
 5298  FF31E3  C9 0A         		cmp	#$0A
3016
 5299  FF31E5  F0 31         		beq	?324
3017
 5300  FF31E7  C9 0D         		cmp	#$0D
3018
 5301  FF31E9  D0 12         		bne	?320a
3019
 5302  FF31EB  A6 BC         		ldx	SMTmpK
3020
 5303  FF31ED  F0 29         		beq	?324
3021
 5304  FF31EF  E0 43         		cpx	#$43
3022
 5305  FF31F1  D0 1B         		bne	?320e
3023
 5306  FF31F3                		ACC16
3024
 5307  FF31F3  C2 20         		rep	#PMFLAG
3025
 5308                        		.LONGA	on
3026
 5309                        		.MNLIST
3027
 5310  FF31F5  E6 BA         		inc	SMTmpL
3028
 5311  FF31F7                		ACC08
3029
 5312  FF31F7  E2 20         		sep	#PMFLAG
3030
 5313                        		.LONGA	off
3031
 5314                        		.MNLIST
3032
 5315  FF31F9  64 BC         		stz	SMTmpK
3033
 5316  FF31FB  80 1B         		bra	?324
3034
 5317  FF31FD  C9 09         	?320a:	cmp	#$09
3035
 5318  FF31FF  F0 17         		beq	?324
3036
 5319  FF3201  C9 20         		cmp	#$20
3037
 5320  FF3203  90 B7         		bcc	?320
3038
 5321  FF3205  A6 BC         		ldx	SMTmpK
3039
  Tue Jul 17 11:00:24 2018                                                                                               Page   50
3040
 
3041
 
3042
 
3043
 
3044
 5322  FF3207  E6 BC         		inc	SMTmpK
3045
 5323  FF3209  DD 00 20      		cmp	!$2000,x
3046
 5324  FF320C  F0 0A         		beq	?324
3047
 5325  FF320E  8E 50 20      	?320e:	stx	$2050
3048
 5326  FF3211  8D 51 20      		sta	$2051
3049
 5327  FF3214  A9 E5         		lda	#$E5
3050
 5328  FF3216  80 15         		bra	?330
3051
 5329  FF3218                	?324:	TXTCHAROUT
3052
 5330  FF3218  02 06         		cop	$06
3053
 5331                        		.MNLIST
3054
 5332  FF321A  24 E5         		bit	SMTmp2+3
3055
 5333  FF321C  10 9E         		bpl	?320
3056
 5334  FF321E                	?325a:
3057
 5335  FF321E  A6 E2         		ldx	SMTmp2
3058
 5336  FF3220  22 F6 07 F8   	?325:	jsl	lspput
3059
 5337  FF3224  90 96         		bcc	?320
3060
 5338  FF3226  C8            		iny
3061
 5339  FF3227  D0 F7         		bne	?325
3062
 5340  FF3229  A9 80         		lda	#$80
3063
 5341  FF322B  80 07         		bra	?350
3064
 5342  FF322D  A8            	?330:	tay
3065
 5343  FF322E  F0 8C         		beq	?320
3066
 5344  FF3230  80 02         		bra	?350
3067
 5345  FF3232  A9 FF         	?340:	lda	#$FF
3068
 5346  FF3234                	?350:	SCN_CR
3069
 5347  FF3234                		SCNPRCHAR
3070
 5348                        		.MLIST
3071
 5349  FF3234  02 07         		cop	$07
3072
 5350                        		.MNLIST
3073
 5351  FF3236  0D            		.DB	$0D
3074
 5352                        		.MNLIST
3075
 5353  FF3237  20 4E 19      		jsr	PrintByte
3076
 5354  FF323A  A6 E2         		ldx	SMTmp2
3077
 5355  FF323C  22 16 08 F8   		jsl	lspres
3078
 5356  FF3240  A5 E7         		lda	SMTmp2+5
3079
 5357  FF3242  EB            		xba
3080
 5358  FF3243  A5 E6         		lda	SMTmp2+4
3081
 5359  FF3245  1B            		tcs
3082
 5360  FF3246  60            		rts
3083
 5361
3084
 5362                        	; #asptest -p<port> -b<baud_rate> -h<handshake> -e -t -n
3085
 5363                        	; -p: port 0 or 1 (default: 0)
3086
 5364                        	; -b: baud rate = 0,1,2,3 (default: 1 = 38,400)
3087
 5365                        	; -h: handshke level = 0,1,2 (defalt: 2)
3088
 5366                        	;	0=none, 1=software, 2=hardware
3089
 5367                        	; -e: enable echo in rx mode (default mode: rx)
3090
 5368                        	; -t: enable tx mode (-e ignored)
3091
 5369                        	; -n: no FIFO
3092
 5370  FF3247                	Cmd_asptst:
3093
 5371                        		.EXTERN lspset2, lspget2, lspput2, lspres2
3094
 5372                        		.PUBLIC Cmd_asptst
3095
 5373
3096
 5374  FF3247                		SCN_CR
3097
 5375  FF3247                		SCNPRCHAR
3098
 5376                        		.MLIST
3099
 5377  FF3247  02 07         		cop	$07
3100
 5378                        		.MNLIST
3101
  Tue Jul 17 11:00:24 2018                                                                                               Page   51
3102
 
3103
 
3104
 
3105
 
3106
 5379  FF3249  0D            		.DB	$0D
3107
 5380                        		.MNLIST
3108
 5381  FF324A  64 E2         		stz	SMTmp2		; port 0
3109
 5382  FF324C  64 E5         		stz	SMTmp2+3	; no echo, rx mode
3110
 5383  FF324E  A9 02         		lda	#2
3111
 5384  FF3250  85 E3         		sta	SMTmp2+1	; hardware handshake
3112
 5385  FF3252  A9 C5         		lda	#11000101B
3113
 5386  FF3254  85 E4         		sta	SMTmp2+2
3114
 5387  FF3256  A9 80         		lda	#$80		; flag
3115
 5388  FF3258  48            		pha
3116
 5389  FF3259  A6 E0         		ldx	cmdlin
3117
 5390  FF325B                		ACC16CLC
3118
 5391  FF325B  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
3119
 5392                        		.LONGA	on
3120
 5393                        		.MNLIST
3121
 5394  FF325D  8A            		txa
3122
 5395  FF325E  69 00 99      		adc	#INPUTBUF
3123
 5396  FF3261  A2 01         		ldx	#^INPUTBUF
3124
 5397  FF3263  DA            		phx			; command line
3125
 5398  FF3264  48            		pha
3126
 5399  FF3265                		ACC08
3127
 5400  FF3265  E2 20         		sep	#PMFLAG
3128
 5401                        		.LONGA	off
3129
 5402                        		.MNLIST
3130
 5403  FF3267  4B            		phk			; option string
3131
 5404  FF3268  F4 AC 33      		pea	#!?100
3132
 5405  FF326B  F4 00 00      		pea	#0		; result
3133
 5406  FF326E  F4 00 00      		pea	#0
3134
 5407  FF3271  22 09 00 FA   	?10:	jsl	_getopt		; get opttion's loop
3135
 5408  FF3275  B0 54         		bcs	?26		; error
3136
 5409  FF3277  AA            		tax			; option char
3137
 5410  FF3278  F0 51         		beq	?26		; end of command line
3138
 5411  FF327A  30 4E         		bmi	?24		; no option argument
3139
 5412  FF327C  C9 70         		cmp	#'p'
3140
 5413  FF327E  D0 08         		bne	?12
3141
 5414  FF3280  A3 01         		lda	$01,s
3142
 5415  FF3282  29 01         		and	#1
3143
 5416  FF3284  85 E2         		sta	SMTmp2		; port
3144
 5417  FF3286  80 E9         		bra	?10
3145
 5418  FF3288  C9 68         	?12:	cmp	#'h'
3146
 5419  FF328A  D0 0E         		bne	?14
3147
 5420  FF328C  A3 01         		lda	$01,s
3148
 5421  FF328E  29 03         		and	#3
3149
 5422  FF3290  C9 03         		cmp	#3
3150
 5423  FF3292  90 02         		bcc	?13
3151
 5424  FF3294  A9 02         		lda	#2
3152
 5425  FF3296  85 E3         	?13:	sta	SMTmp2+1	; handshake
3153
 5426  FF3298  80 D7         		bra	?10
3154
 5427  FF329A  C9 62         	?14:	cmp	#'b'
3155
 5428  FF329C  D0 0E         		bne	?16
3156
 5429  FF329E  A3 01         		lda	$01,s
3157
 5430  FF32A0  29 03         		and	#3
3158
 5431  FF32A2  AA            		tax
3159
 5432  FF32A3  A9 03         		lda	#3
3160
 5433  FF32A5  14 E4         		trb	SMTmp2+2
3161
 5434  FF32A7  8A            		txa
3162
 5435  FF32A8  04 E4         		tsb	SMTmp2+2
3163
  Tue Jul 17 11:00:24 2018                                                                                               Page   52
3164
 
3165
 
3166
 
3167
 
3168
 5436  FF32AA  80 C5         		bra	?10
3169
 5437  FF32AC  C9 6E         	?16:	cmp	#'n'
3170
 5438  FF32AE  D0 06         		bne	?20
3171
 5439  FF32B0  A9 20         		lda	#$20
3172
 5440  FF32B2  04 E4         		tsb	SMTmp2+2
3173
 5441  FF32B4  80 BB         		bra	?10
3174
 5442  FF32B6  C9 65         	?20:	cmp	#'e'
3175
 5443  FF32B8  D0 06         		bne	?22
3176
 5444  FF32BA  A9 80         		lda	#$80
3177
 5445  FF32BC  04 E5         		tsb	SMTmp2+3	; rx+echo mode
3178
 5446  FF32BE  80 B1         		bra	?10
3179
 5447  FF32C0  C9 74         	?22:	cmp	#'t'
3180
 5448  FF32C2  D0 06         		bne	?24
3181
 5449  FF32C4  A9 40         		lda	#$40
3182
 5450  FF32C6  04 E5         		tsb	SMTmp2+3	; tx mode
3183
 5451  FF32C8  80 A7         		bra	?10
3184
 5452  FF32CA  38            	?24:	sec
3185
 5453  FF32CB  08            	?26:	php			; clean stack
3186
 5454  FF32CC  FA            		plx			; save carry
3187
 5455  FF32CD                		ACC16CLC
3188
 5456  FF32CD  C2 21         		rep	#(PMFLAG.OR.PCFLAG)
3189
 5457                        		.LONGA	on
3190
 5458                        		.MNLIST
3191
 5459  FF32CF  3B            		tsc
3192
 5460  FF32D0  69 0B 00      		adc	#11
3193
 5461  FF32D3  1B            		tcs
3194
 5462  FF32D4                		ACC08
3195
 5463  FF32D4  E2 20         		sep	#PMFLAG
3196
 5464                        		.LONGA	off
3197
 5465                        		.MNLIST
3198
 5466  FF32D6  8A            		txa
3199
 5467  FF32D7  4A            		lsr	a		; test carry
3200
 5468  FF32D8  90 03         		bcc	?28		; ok
3201
 5469  FF32DA  4C 34 01      		jmp	ErrCls2
3202
 5470  FF32DD  A5 E3         	?28:	lda	SMTmp2+1
3203
 5471  FF32DF  D0 06         		bne	?30
3204
 5472  FF32E1  A9 C0         		lda	#$C0
3205
 5473  FF32E3  14 E4         		trb	SMTmp2+2
3206
 5474  FF32E5  80 12         		bra	?34
3207
 5475  FF32E7  C9 01         	?30:	cmp	#1
3208
 5476  FF32E9  D0 0A         		bne	?32
3209
 5477  FF32EB  A9 C0         		lda	#$C0
3210
 5478  FF32ED  14 E4         		trb	SMTmp2+2
3211
 5479  FF32EF  A9 80         		lda	#$80
3212
 5480  FF32F1  04 E4         		tsb	SMTmp2+2
3213
 5481  FF32F3  80 04         		bra	?34
3214
 5482  FF32F5  A9 C0         	?32:	lda	#$C0
3215
 5483  FF32F7  04 E4         		tsb	SMTmp2+2
3216
 5484  FF32F9  A6 E2         	?34:	ldx	SMTmp2		; X=port
3217
 5485  FF32FB  A5 E4         		lda	SMTmp2+2	; A=mode
3218
 5486  FF32FD  22 78 0D F8   		jsl	lspset2
3219
 5487  FF3301  A5 E2         		lda	SMTmp2
3220
 5488  FF3303  0A            		asl	a
3221
 5489  FF3304  0A            		asl	a
3222
 5490  FF3305  85 E3         		sta	SMTmp2+1
3223
 5491  FF3307  3B            		tsc
3224
 5492  FF3308  85 E6         		sta	SMTmp2+4
3225
  Tue Jul 17 11:00:24 2018                                                                                               Page   53
3226
 
3227
 
3228
 
3229
 
3230
 5493  FF330A  EB            		xba
3231
 5494  FF330B  85 E7         		sta	SMTmp2+5
3232
 5495  FF330D  24 E5         		bit	SMTmp2+3	; check tx/rx mode
3233
 5496  FF330F  70 03         		bvs	?40		; tx mode
3234
 5497  FF3311  4C B9 33      		jmp	?300
3235
 5498  FF3314
3236
 5499  FF3314  64 BA         	?40:	stz	SMTmpL
3237
 5500  FF3316  64 BB         		stz	SMTmpH
3238
 5501  FF3318  A6 E2         	?41:	ldx	SMTmp2
3239
 5502  FF331A  F0 05         		beq	?41a
3240
 5503  FF331C  2C 16 05      		bit	!DP05ADDR+splin3
3241
 5504  FF331F  80 03         		bra	?41b
3242
 5505  FF3321  2C 2C 05      	?41a:	bit	!DP05ADDR+splin4
3243
 5506  FF3324  50 07         	?41b:	bvc	?42		; on line
3244
 5507  FF3326  20 80 1A      		jsr	CkStop
3245
 5508  FF3329  D0 ED         		bne	?41
3246
 5509  FF332B  F0 47         		beq	?90		; stop
3247
 5510  FF332D  A9 0D         	?42:	lda	#$0D
3248
 5511  FF332F  20 8C 33      		jsr	?200
3249
 5512  FF3332  20 80 1A      	?45:	jsr	CkStop		; loop TX
3250
 5513  FF3335  F0 3D         		beq	?90		; stop
3251
 5514  FF3337  A5 BB         		lda	SMTmpH
3252
 5515  FF3339  20 7C 19      		jsr	FF_Byte2Hex
3253
 5516  FF333C  DA            		phx
3254
 5517  FF333D  20 8C 33      		jsr	?200		; send
3255
 5518  FF3340  68            		pla
3256
 5519  FF3341  20 8C 33      		jsr	?200		; send
3257
 5520  FF3344  A5 BA         		lda	SMTmpL
3258
 5521  FF3346  20 7C 19      		jsr	FF_Byte2Hex
3259
 5522  FF3349  DA            		phx
3260
 5523  FF334A  20 8C 33      		jsr	?200
3261
 5524  FF334D  68            		pla
3262
 5525  FF334E  20 8C 33      		jsr	?200
3263
 5526  FF3351  A9 20         		lda	#' '
3264
 5527  FF3353  20 8C 33      		jsr	?200
3265
 5528  FF3356  A9 40         		lda	#$40
3266
 5529  FF3358  85 BC         		sta	SMTmpK
3267
 5530  FF335A  A5 BC         	?47:	lda	SMTmpK
3268
 5531  FF335C  20 8C 33      		jsr	?200
3269
 5532  FF335F  E6 BC         		inc	SMTmpK
3270
 5533  FF3361  A5 BC         		lda	SMTmpK
3271
 5534  FF3363  C9 7E         		cmp	#$7E
3272
 5535  FF3365  90 F3         		bcc	?47
3273
 5536  FF3367  A9 0D         		lda	#$0D
3274
 5537  FF3369  20 8C 33      		jsr	?200
3275
 5538  FF336C                		ACC16
3276
 5539  FF336C  C2 20         		rep	#PMFLAG
3277
 5540                        		.LONGA	on
3278
 5541                        		.MNLIST
3279
 5542  FF336E  E6 BA         		inc	SMTmpL
3280
 5543                        		;lda	SMTmpL
3281
 5544                        		;cmp	#8
3282
 5545  FF3370                		ACC08
3283
 5546  FF3370  E2 20         		sep	#PMFLAG
3284
 5547                        		.LONGA	off
3285
 5548                        		.MNLIST
3286
 5549  FF3372  80 BE         		bra	?45
3287
  Tue Jul 17 11:00:24 2018                                                                                               Page   54
3288
 
3289
 
3290
 
3291
 
3292
 5550                        		;bcc	?45
3293
 5551  FF3374
3294
 5552  FF3374  A9 FF         	?90:	lda	#$FF		; stop: CTRL BREAK
3295
 5553  FF3376                	?91:	SCN_CR
3296
 5554  FF3376                		SCNPRCHAR
3297
 5555                        		.MLIST
3298
 5556  FF3376  02 07         		cop	$07
3299
 5557                        		.MNLIST
3300
 5558  FF3378  0D            		.DB	$0D
3301
 5559                        		.MNLIST
3302
 5560  FF3379  20 4E 19      		jsr	PrintByte
3303
 5561  FF337C                		SCN_CR
3304
 5562  FF337C                		SCNPRCHAR
3305
 5563                        		.MLIST
3306
 5564  FF337C  02 07         		cop	$07
3307
 5565                        		.MNLIST
3308
 5566  FF337E  0D            		.DB	$0D
3309
 5567                        		.MNLIST
3310
 5568  FF337F  A6 E2         	?99:	ldx	SMTmp2
3311
 5569  FF3381  22 8A 0D F8   		jsl	lspres2
3312
 5570  FF3385  A5 E7         		lda	SMTmp2+5
3313
 5571  FF3387  EB            		xba
3314
 5572  FF3388  A5 E6         		lda	SMTmp2+4
3315
 5573  FF338A  1B            		tcs
3316
 5574  FF338B  60            		rts
3317
 5575  FF338C
3318
 5576  FF338C  A6 E2         	?200:	ldx	SMTmp2
3319
 5577  FF338E  22 66 0D F8   	?210:	jsl	lspput2
3320
 5578  FF3392  90 07         		bcc	?215
3321
 5579  FF3394  C8            		iny
3322
 5580  FF3395  D0 F7         		bne	?210
3323
 5581  FF3397  A9 80         		lda	#$80		; remote off-line
3324
 5582  FF3399  80 DB         		bra	?91
3325
 5583  FF339B
3326
 5584  FF339B  24 E5         	?215:	bit	SMTmp2+3
3327
 5585  FF339D  10 0C         		bpl	?250
3328
 5586  FF339F  22 54 0D F8   		jsl	lspget2
3329
 5587  FF33A3  B0 03         		bcs	?220
3330
 5588  FF33A5                		TXTCHAROUT
3331
 5589  FF33A5  02 06         		cop	$06
3332
 5590                        		.MNLIST
3333
 5591  FF33A7  60            		rts
3334
 5592  FF33A8  A8            	?220:	tay
3335
 5593  FF33A9  D0 CB         		bne	?91
3336
 5594  FF33AB  60            	?250:	rts
3337
 5595
3338
 5596  FF33AC
3339
 5597  FF33AC  70 25 62 25 68 	?100:	.DB	'p%b%h%e t n ', 0
3340
               25 65 20 74 20
3341
               6E 20 00
3342
 5598
3343
 5599                        	; RX mode
3344
 5600  FF33B9  A9 30         	?300:	lda	#'0'
3345
 5601  FF33BB  8D 00 20      		sta	!$2000
3346
 5602  FF33BE  8D 01 20      		sta	!$2001
3347
 5603  FF33C1  8D 02 20      		sta	!$2002
3348
 5604  FF33C4  8D 03 20      		sta	!$2003
3349
  Tue Jul 17 11:00:24 2018                                                                                               Page   55
3350
 
3351
 
3352
 
3353
 
3354
 5605  FF33C7  A9 20         		lda	#' '
3355
 5606  FF33C9  8D 04 20      		sta	!$2004
3356
 5607  FF33CC  A9 40         		lda	#$40
3357
 5608  FF33CE  A2 00         		ldx	#0
3358
 5609  FF33D0  9D 05 20      	?300l:	sta	!$2005,x
3359
 5610  FF33D3  E8            		inx
3360
 5611  FF33D4  1A            		inc	a
3361
 5612  FF33D5  C9 7E         		cmp	#$7E
3362
 5613  FF33D7  90 F7         		bcc	?300l
3363
 5614  FF33D9  9E 05 20      		stz	!$2005,x
3364
 5615  FF33DC  64 BA         	?300w:	stz	SMTmpL
3365
 5616  FF33DE  64 BB         		stz	SMTmpH
3366
 5617  FF33E0  64 BC         		stz	SMTmpK
3367
 5618  FF33E2  A6 E2         		ldx	SMTmp2
3368
 5619  FF33E4  F0 05         		beq	?320aa
3369
 5620  FF33E6  2C 16 05      		bit	!DP05ADDR+splin3
3370
 5621  FF33E9  80 03         		bra	?320b
3371
 5622  FF33EB  2C 2C 05      	?320aa:	bit	!DP05ADDR+splin4
3372
 5623  FF33EE  10 08         	?320b:	bpl	?320		; on line
3373
 5624  FF33F0  20 80 1A      		jsr	CkStop
3374
 5625  FF33F3  D0 E7         		bne	?300w
3375
 5626                        		;beq	?340
3376
 5627  FF33F5  4C 78 34      		jmp	?340
3377
 5628
3378
 5629  FF33F8  A5 BC         	?320:	lda	SMTmpK
3379
 5630  FF33FA  D0 16         		bne	?320z
3380
 5631
3381
 5632  FF33FC  A5 BB         		lda	SMTmpH
3382
 5633  FF33FE  20 7C 19      		jsr	FF_Byte2Hex
3383
 5634  FF3401  8D 00 20      		sta	!$2000
3384
 5635  FF3404  8E 01 20      		stx	.ABS.$2001
3385
 5636  FF3407  A5 BA         		lda	SMTmpL
3386
 5637  FF3409  20 7C 19      		jsr	FF_Byte2Hex
3387
 5638  FF340C  8D 02 20      		sta	!$2002
3388
 5639  FF340F  8E 03 20      		stx	.ABS.$2003
3389
 5640  FF3412
3390
 5641  FF3412  20 80 1A      	?320z:	jsr	CkStop
3391
 5642  FF3415  F0 61         		beq	?340
3392
 5643  FF3417  A6 E2         		ldx	SMTmp2
3393
 5644  FF3419  22 54 0D F8   		jsl	lspget2
3394
 5645  FF341D  B0 54         		bcs	?330
3395
 5646  FF341F  C9 0A         		cmp	#$0A
3396
 5647  FF3421  F0 3B         		beq	?324
3397
 5648  FF3423  C9 0D         		cmp	#$0D
3398
 5649  FF3425  D0 1C         		bne	?320a
3399
 5650  FF3427  A6 BC         		ldx	SMTmpK
3400
 5651  FF3429  F0 33         		beq	?324
3401
 5652  FF342B  E0 43         		cpx	#$43
3402
 5653                        		;bne	?320e
3403
 5654  FF342D  F0 0A         		beq	?320xxx
3404
 5655  FF342F  8E 50 20      		stx	$2050
3405
 5656  FF3432  8D 51 20      		sta	$2051
3406
 5657  FF3435  A9 E6         		lda	#$E6
3407
 5658  FF3437  80 3A         		bra	?330
3408
 5659  FF3439
3409
 5660  FF3439                	?320xxx:
3410
 5661  FF3439                		ACC16
3411
  Tue Jul 17 11:00:24 2018                                                                                               Page   56
3412
 
3413
 
3414
 
3415
 
3416
 5662  FF3439  C2 20         		rep	#PMFLAG
3417
 5663                        		.LONGA	on
3418
 5664                        		.MNLIST
3419
 5665  FF343B  E6 BA         		inc	SMTmpL
3420
 5666  FF343D                		ACC08
3421
 5667  FF343D  E2 20         		sep	#PMFLAG
3422
 5668                        		.LONGA	off
3423
 5669                        		.MNLIST
3424
 5670  FF343F  64 BC         		stz	SMTmpK
3425
 5671  FF3441  80 1B         		bra	?324
3426
 5672  FF3443  C9 09         	?320a:	cmp	#$09
3427
 5673  FF3445  F0 17         		beq	?324
3428
 5674  FF3447  C9 20         		cmp	#$20
3429
 5675  FF3449  90 AD         		bcc	?320
3430
 5676  FF344B  A6 BC         		ldx	SMTmpK
3431
 5677  FF344D  E6 BC         		inc	SMTmpK
3432
 5678  FF344F  DD 00 20      		cmp	!$2000,x
3433
 5679  FF3452  F0 0A         		beq	?324
3434
 5680                        		;bne	?324
3435
 5681  FF3454  8E 50 20      	?320e:	stx	$2050
3436
 5682  FF3457  8D 51 20      		sta	$2051
3437
 5683  FF345A  A9 E5         		lda	#$E5
3438
 5684  FF345C  80 15         		bra	?330
3439
 5685  FF345E                	?324:	TXTCHAROUT
3440
 5686  FF345E  02 06         		cop	$06
3441
 5687                        		.MNLIST
3442
 5688  FF3460  24 E5         		bit	SMTmp2+3
3443
 5689  FF3462  10 94         		bpl	?320
3444
 5690  FF3464                	?325a:
3445
 5691  FF3464  A6 E2         		ldx	SMTmp2
3446
 5692  FF3466  22 66 0D F8   	?325:	jsl	lspput2
3447
 5693  FF346A  90 8C         		bcc	?320
3448
 5694  FF346C  C8            		iny
3449
 5695  FF346D  D0 F7         		bne	?325
3450
 5696  FF346F  A9 80         		lda	#$80
3451
 5697  FF3471  80 07         		bra	?350
3452
 5698  FF3473  A8            	?330:	tay
3453
 5699  FF3474  F0 82         		beq	?320
3454
 5700  FF3476  80 02         		bra	?350
3455
 5701  FF3478  A9 FF         	?340:	lda	#$FF
3456
 5702  FF347A                	?350:	SCN_CR
3457
 5703  FF347A                		SCNPRCHAR
3458
 5704                        		.MLIST
3459
 5705  FF347A  02 07         		cop	$07
3460
 5706                        		.MNLIST
3461
 5707  FF347C  0D            		.DB	$0D
3462
 5708                        		.MNLIST
3463
 5709  FF347D  20 4E 19      		jsr	PrintByte
3464
 5710  FF3480  A6 E2         		ldx	SMTmp2
3465
 5711  FF3482  22 8A 0D F8   		jsl	lspres2
3466
 5712  FF3486  A5 E7         		lda	SMTmp2+5
3467
 5713  FF3488  EB            		xba
3468
 5714  FF3489  A5 E6         		lda	SMTmp2+4
3469
 5715  FF348B  1B            		tcs
3470
 5716  FF348C  60            		rts
3471
 5717
3472
 5718  FF348D                	ATACPYSTR1:
3473
  Tue Jul 17 11:00:24 2018                                                                                               Page   57
3474
 
3475
 
3476
 
3477
 
3478
 5719  FF348D  72 65 61 64 20 		.DB	'read  %02bX sect. from %08X to %08X (Total %08X, dev. #%01bX)', $00
3479
               20 25 30 32 62
3480
               58 20 73 65 63
3481
               74 2E 20 66 72
3482
               6F 6D 20 25 30
3483
               38 58 20 74 6F
3484
               20 25 30 38 58
3485
               20 28 54 6F 74
3486
               61 6C 20 25 30
3487
               38 58 2C 20 64
3488
               65 76 2E 20 23
3489
               25 30 31 62 58
3490
               29 00
3491
 5720
3492
 5721  FF34CB                	ATACPYSTR2:
3493
 5722  FF34CB  77 72 69 74 65 		.DB	'write %02bX sect. from %08X to %08X (Total %08X, dev. #%01bX)', $00
3494
               20 25 30 32 62
3495
               58 20 73 65 63
3496
               74 2E 20 66 72
3497
               6F 6D 20 25 30
3498
               38 58 20 74 6F
3499
               20 25 30 38 58
3500
               20 28 54 6F 74
3501
               61 6C 20 25 30
3502
               38 58 2C 20 64
3503
               65 76 2E 20 23
3504
               25 30 31 62 58
3505
               29 00
3506
 
3507
 
3508
             Lines Assembled : 5193                  Errors : 0
3509
 
3510
 
3511