Subversion Repositories MB01 Project

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
  Tue Jul 17 11:00:17 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\F8\bios.asm
13
                       Output Filename : obj\F8\bios.obj
14
                       Listing Has Been Relocated
15
 
16
 
17
 2605                        	.LIST		on
18
 2606
19
 2607  F8FFB1                		.INCLUDE 	inc\dirp00.inc
20
 2608                        	;----------------------------------------------------------
21
 2609                        	; DIRP00.ASM
22
 2610                        	; PROGETTO: B1601
23
 2611                        	;
24
 2612                        	; Variabili in Direct Page $00
25
 2613                        	;----------------------------------------------------------
26
 2614
27
 2615                        	; sezione COMMON -- questo permette di includere il file in piu' file
28
 2616
29
 2617                        	.LIST on
30
 2618
31
 2619                        	DIRP00:	.SECTION page0, ref_only, common	;Direct-Page 00
32
 2620
33
 2621  000000                		.ABSOLUTE		;; inizia sempre da $00
34
 2622  000000                		.ORG		0x00
35
 2623  000000
36
 2624  000000  0000          	JiffyClk	.DW			; contatore 10ms 32 bit
37
 2625  000002  0000          			.DW
38
 2626  000004                	SysTmr		.DS	SYSTMRCNT	; system timer 0 (10ms)
39
 2627  000008                	SysTMF		.DS	SYSTMRCNT	; flag timer (80 -> start)
40
 2628  00000C  00            	Bnk0Flag	.DB			; <7>: flag test RAM banco 0 ok
41
 2629                        						; <6>: flag warm reset
42
 2630  00000D  00            	RTCFlag		.DB
43
 2631
44
 2632  00000E                	diskstat	.DS	2	; flag device on ata bus #0 & #1
45
 2633                        					; <7>: device ready
46
 2634                        					; <6>: compact flash device (C.F.)
47
 2635                        					; <5>: device identification ok
48
 2636                        					; <4>: MBR loaded
49
 2637                        					; <3>: valid signature in MBR
50
 2638                        					; <2>: first partition found&active
51
 2639                        					; <1>:
52
 2640                        					; <0>: valid partition flag
53
 2641
54
 2642                        					; <7>: device ready
55
 2643                        					; <6>: USB device
56
 2644                        					; <5>: compact flash device (C.F.)
57
 2645                        					; <4>: device identification ok
58
 2646                        					; <3>: MBR loaded
59
 2647                        					; <2>: first partition found&active
60
 2648                        					; <1>: always 1
61
 2649                        					; <0>: valid partition flag
62
 2650  000010
63
  Tue Jul 17 11:00:17 2018                                                                                               Page    2
64
 
65
 
66
 
67
 
68
 2651
69
 2652          00000E        	atadev		.EQU	diskstat
70
 2653
71
 2654  000010                	usbdev		.DS	2	; flag flash disk on usb bus #0
72
 2655                        					; <7>: device plugged and ready
73
 2656                        					; <6>: always 1
74
 2657                        					; <5>: device identification ok
75
 2658                        					; <4>: MBR loaded
76
 2659                        					; <3>: valid signature in MBR
77
 2660                        					; <2>: first partition found&active
78
 2661                        					; <1>:
79
 2662                        					; <0>: valid partition flag
80
 2663
81
 2664  000012                	diskmax		.DS	16	; disk max. sector's
82
 2665          000012        	atasec		.EQU	diskmax
83
 2666          00001A        	usbsec		.EQU	diskmax+8
84
 2667
85
 2668
86
 2669  000022                	atambr		.DS	8	; data for first partition found in mbr
87
 2670                        					; first 3 bytes for start sector of partition
88
 2671                        					; last byte for partition type
89
 2672  00002A                	usbmbr		.DS	8
90
 2673
91
 2674  000032                	ataprt		.DS	8	; total sec's of first partition
92
 2675  00003A                	usbprt		.DS	8	; total sec's of first partition
93
 2676
94
 2677
95
 2678  000042  00            	usb0ch		.DB	; usb0 (ch375/ch376) flag
96
 2679                        				; <7>: module on
97
 2680                        				; <6>: ch376 flag
98
 2681                        				; <5:0>: chip version
99
 2682
100
 2683  000043  00            	usb0st		.DB	; usb0 status
101
 2684                        				; <7>: usb0 host mode ok
102
 2685                        				; <6>: flash disk attached flag
103
 2686                        				; <5>: usb device attached
104
 2687
105
 2688  000044  00            	fdcdrv		.DB		; phisycal drive status (drive #0)
106
 2689                        					; <7>: disk format established in bit 0&1
107
 2690                        					; <6>: double step seek done
108
 2691                        					; <5>: trust format bit's (set after ok r/w)
109
 2692                        					; <4>: write protect bit (if disk in drive)
110
 2693                        					; <3>: don't care
111
 2694                        					; <2>: don't care
112
 2695                        					; <1>: HD disk if set else DD disk
113
 2696                        					; <0>: CBM format if set else IBM format
114
 2697
115
 2698  000045  00            	vdrive		.DB		; virtual drive status (ram disk, drive #1)
116
 2699                        					; <7>: disk format established in bit 0&1
117
 2700                        					; <6>: change disk simulation (after format)
118
 2701                        					; <5>: don't care
119
 2702                        					; <4>: write protect bit (under sw control)
120
 2703                        					; <3>: don't care
121
 2704                        					; <2>: don't care
122
 2705                        					; <1>: HD disk if set else DD disk
123
 2706                        					; <0>: CBM format if set else IBM format
124
 2707
125
  Tue Jul 17 11:00:17 2018                                                                                               Page    3
126
 
127
 
128
 
129
 
130
 2708  000046  00            	fdcctl		.DB		; fdc controller status
131
 2709                        					; <7>: drive is attached
132
 2710                        					; <6>: drive need recalibration (restore)
133
 2711                        					; <5>: FDC controller ok
134
 2712                        					; <4>: motor on
135
 2713                        					; <3>: dma is active
136
 2714                        					; <2>: dma chip ok (post routine)
137
 2715                        					; <1>: clock rate (1=HD,0=DD)
138
 2716                        					; <0>: disk ready
139
 2717
140
 2718  000047  00            	fdctrk		.DB		; fd: current seek track
141
 2719  000048  00            	fdcerr		.DB		; fd: last error code
142
 2720  000049  00            	ataerr		.DB		; ata: last error code
143
 2721  00004A  00            	ataxer		.DB		; ata: last extended error code
144
 2722
145
 2723  00004B  00            	CtrlBrk		.DB		; flag CTRL+BREAK (NMI)
146
 2724
147
 2725  00004C  0000          	MemTop		.DW		; top memoria RAM
148
 2726  00004E  00            			.DB		; banco top mem
149
 2727
150
 2728  00004F  00            	DflTxtIn	.DB		; device di default text input
151
 2729  000050  00            	DflTxtOut	.DB		; device di default text output
152
 2730
153
 2731  000051                	COPPtr		LP		; long pointer for COP decoding
154
 2732  000054  00            	COPIdx		.DB		; COP signature/index
155
 2733
156
 2734  000055  00            	BiosEnt		.DB		; flag accesso a bios setup
157
 2735
158
 2736                        	; variabili utilizzate da ACIA
159
 2737  000056                	spwrk		.DS	$30
160
 2738
161
 2739                        	; bios mem
162
 2740  000086  0000          	nsize		.DW	; dimensione blocco da allocare
163
 2741                        	;bsize		.DW	; dimensione vera blocco free
164
 2742  000088  0000          	splitsz		.DW	; dimensione blocco splittato
165
 2743  00008A  0000          	bfree		.DW	; puntatore blocco free
166
 2744  00008C  0000          	hdrptr		.DW	; puntatore header heap
167
 2745
168
 2746  00008E  0000          	pbrklv		.DW	; current break level of current process
169
 2747  000090  0000          	pbrkmin		.DW	; minimum breal level of current process
170
 2748  000092  0000          	pbrkmax		.DW	; maximum breal level of current process
171
 2749  000094
172
 2750                        	; bios temp. work area
173
 2751  000094                	bwrktmp		.DS	$28
174
 2752
175
 2753  0000BC  00            	coptmp		.DB	; temp. used while cop
176
 2754
177
 2755  0000BD  00            	tstser		.DB	; check ser/usb test board post
178
 2756                        				; <7>: VIA2 ok
179
 2757                        				; <6>: PICRAM ok
180
 2758                        				; <1>: UART 16C550 ok
181
 2759                        				; <0>: R65C51 ok
182
 2760
183
 2761
184
 2762                        	;crc16		.DW
185
 2763
186
 2764  0000BD                		.RELATIVE
187
  Tue Jul 17 11:00:17 2018                                                                                               Page    4
188
 
189
 
190
 
191
 
192
 2765
193
 2766                        		.ENDS
194
 2767
195
 2768          [01]          	.IFDEF		_ACIA_INC_
196
 2769                        		.INCLUDE INC\SP.INC
197
 2770          [00]          	.ENDIF
198
 2771
199
 2785                        	.LIST on
200
 2786
201
 2787          000060        	KBDBUFLEN	.EQU	96		; dimensione buffer di tastiera
202
 2788
203
 2789                        	DIRP01:	.SECTION page0, ref_only, common	;Direct-Page 01
204
 2790
205
 2791  000000                		.ABSOLUTE		;; inizia sempre da $00
206
 2792  000000                		.ORG		0x00
207
 2793
208
 2794  000000
209
 2795  000000                	KbdBuf		.DS	KBDBUFLEN	; buffer della tastiera
210
 2796  000060  00            	KbdITail	.DB			; coda buffer tastiera
211
 2797  000061  00            	KbdIHead	.DB			; testa buffer tastiera
212
 2798  000062  00            	KbdCnt		.DB			; numero bytes nel buffer
213
 2799  000063  00            	KbdShift	.DB
214
 2800  000064  00            	KbdFlag		.DB
215
 2801  000065  00            	KbdToggle	.DB
216
 2802  000066  00            	KbdSt		.DB			; status tastiera dopo reset
217
 2803  000067  00            	PS2Ctl		.DB			; flag controller PS2 keyboard
218
 2804
219
 2805  000068  00            	LCDFlag		.DB
220
 2806  000069  00            	LCDTmp		.DB
221
 2807  00006A  0000          	LCDVal		.DW
222
 2808
223
 2809  00006C  00            	VBBFlag		.DB		; flag video board
224
 2810  00006D  00            	VBBRam		.DB		; flag video RAM
225
 2811
226
 2812  00006E  00            	ScnLinTmp	.DB
227
 2813  00006F  00            	ScnChBase	.DB		; base video ram VDC
228
 2814  000070  00            	ScnAttBase	.DB		; base ram attributi VDC
229
 2815  000071  00            	ScnCursMode	.DB		; VDC cursore default
230
 2816  000072  00            	ScnSaveAttr	.DB
231
 2817  000073  00            	ScnInsert	.DB
232
 2818  000074  00            	ScnAutoIns	.DB		; bit 7 -> autoins - bit 6 -> modo input
233
 2819  000075  00            	ScnScroll	.DB
234
 2820  000076  00            	ScnMaxRow	.DB		; max. righe finestra (-1)
235
 2821  000077  00            	ScnMaxCols	.DB		; max. colonne finestra (-1)
236
 2822
237
 2823  000078                	ScnMapTabs1	.DS	10
238
 2824  000082                	ScnMapTabs2	.DS	4
239
 2825  000086
240
 2826  000086  0000          	ScnPtr		.DW		; puntatore video ram linea corrente
241
 2827  000088  00            			.DB
242
 2828
243
 2829  000089  00            	ScnFiltLen	.DB		; lunghezza set caratteri filtro
244
 2830
245
 2831  00008A  0000          	ScnAtPtr	.DW		; puntatore attributi ram linea corrente
246
 2832  00008C  00            			.DB
247
 2833
248
 2834  00008D  00            	ScnTmpx		.DB		; temporaneo: durante put char
249
  Tue Jul 17 11:00:17 2018                                                                                               Page    5
250
 
251
 
252
 
253
 
254
 2835  00008E
255
 2836  00008E  00            	ScnTop		.DB		; riga superiore finestra
256
 2837  00008F  00            	ScnLeft		.DB		; colonna sinistra finestra
257
 2838  000090  00            	ScnBottom	.DB		; riga inferiore finestra
258
 2839  000091  00            	ScnRight	.DB		; colonna destra finestra
259
 2840  000092  00            	ScnAttr		.DB		; attributo default
260
 2841  000093  00            	ScnAttr2	.DB		; attributo alternativo
261
 2842  000094  00            	ScnRow		.DB		; riga cursore
262
 2843  000095  00            	ScnCol		.DB		; colonna cursore
263
 2844  000096  00            	ScnRowStart	.DB		; riga di start input
264
 2845  000097  00            	ScnInput	.DB		; riga di fine input
265
 2846  000098  00            	ScnColStart	.DB		; colonna di start input
266
 2847  000099  00            	ScnSaveX	.DB
267
 2848  00009A  00            	ScnSaveY	.DB
268
 2849  00009B  00            	ScnTmpL		.DB
269
 2850  00009C  00            	ScnTmpH		.DB
270
 2851  00009D  00            	ScnSaveRow	.DB
271
 2852  00009E  00            	ScnSaveCol	.DB
272
 2853  00009F  00            	ScnCurChr	.DB
273
 2854  0000A0  00            	ScnLstChr	.DB
274
 2855  0000A1  00            	ScnCR		.DB
275
 2856  0000A2  0000          	ScnPrm		.DW		; puntatore long utilizzato da print imm
276
 2857  0000A4  00            			.DB		; banco puntatore ScnPrm
277
 2858  0000A5  00            	ScnMode		.DB		; flag modo schermo
278
 2859
279
 2860  0000A6                	ScnPtr1		LP
280
 2861
281
 2862  0000A9  00            	ScnDefCol	.DB		; default foreground color
282
 2863
283
 2864  0000AA                	ScnPtr2		LP
284
 2865
285
 2866  0000AD  00            	ScnDefBkgCol	.DB		; default background color
286
 2867  0000AE  00            	ScnInpRow	.DB		; modo input line: riga start input
287
 2868  0000AF  00            	ScnInpCol	.DB		; modo input line: colonna start input
288
 2869  0000B0  00            	ScnLstRow	.DB		; modo input line: riga stop input
289
 2870  0000B1  00            	ScnLstCol	.DB		; modo input line: colonna stop input
290
 2871  0000B2  00            	ScnFlag		.DB		; Bit 7: input line - Bit 6: input riga unica
291
 2872  0000B3  00            	ScnMask		.DB		; flag tasti funzione editor di linea
292
 2873  0000B4  00            	ScnFilt		.DB		; filtro tasti editor di linea
293
 2874  0000B5  00            	ScnCntrl	.DB		; flag ASCII/CONTROL
294
 2875                        	;DflTxtIn	.DB		; device di default text input
295
 2876                        	;DflTxtOut	.DB		; device di default text output
296
 2877  0000B6
297
 2878          000047        	SCNCLRLEN	.EQU	($ - ScnLinTmp - 1)
298
 2879
299
 2880                        	;SCNCLRLEN	.EQU	(DflTxtOut - ScnLinTmp)
300
 2881
301
 2882                        	; variabili monitor
302
 2883  0000B6  00            	SMAddrL		.DB	; address low/high
303
 2884  0000B7  00            	SMAddrH		.DB
304
 2885  0000B8  00            	SMAddrK		.DB	; address bank
305
 2886  0000B9  00            	SMFlag32	.DB	; flag parametro 32 bit
306
 2887  0000BA  00            	SMTmpL		.DB	; temp. low/high
307
 2888  0000BB  00            	SMTmpH		.DB
308
 2889  0000BC  00            	SMTmpK		.DB	; temp. bank
309
 2890  0000BD  00            	SMTmpKK		.DB	; high byte param. 32 bit
310
 2891  0000BE  00            	SMSizeL		.DB	; size low/high
311
  Tue Jul 17 11:00:17 2018                                                                                               Page    6
312
 
313
 
314
 
315
 
316
 2892  0000BF  00            	SMSizeH		.DB
317
 2893  0000C0  00            	SMSizeK		.DB	; size bank
318
 2894  0000C1  00            	SMXAddrL	.DB	; address low/high XM
319
 2895  0000C2  00            	SMXAddrH	.DB
320
 2896  0000C3  00            	SMXAddrK	.DB	; address bank XM
321
 2897  0000C4  00            	SMbndx		.DB	; indice input buffer
322
 2898  0000C5  00            	SMnprm		.DB	; numero parametri riga di comando
323
 2899  0000C6  00            	SMdumb		.DB
324
 2900  0000C7  00            	SMkr		.DB
325
 2901  0000C8  0000          	SMpc		.DW
326
 2902  0000CA  00            	SMsr		.DB
327
 2903  0000CB  00            	SMbr		.DB
328
 2904  0000CC  0000          	SMdp		.DW
329
 2905  0000CE  0000          	SMac		.DW
330
 2906  0000D0  0000          	SMxr		.DW
331
 2907  0000D2  0000          	SMyr		.DW
332
 2908  0000D4  0000          	SMsp		.DW
333
 2909
334
 2910  0000D6  00            	SMAuxL		.DB
335
 2911  0000D7  00            	SMAuxH		.DB
336
 2912
337
 2913  0000D8  00            	asmlong		.DB	; flag for CPU in 16 mode
338
 2914                        				; <7> -> A/M in 16 bit mode
339
 2915                        				; <6> -> X/Y in 16 bit mode
340
 2916  0000D9  00            	asmcpu		.DB	; <7> -> 8 bit family
341
 2917                        				; <6> -> 65C02 cmos version
342
 2918
343
 2919  0000DA  00            	SMctx		.DB	; context (if = $00 no quit command)
344
 2920  0000DB                	SMrsm		LP	; long pointer to resume caller context
345
 2921
346
 2922  0000DE  00            	rtcadr		.DB	; rtc internal ram address
347
 2923  0000DF  00            	rtcbnk		.DB	; RTC internal bank ram
348
 2924  0000E0  00            	cmdlin		.DB	;
349
 2925  0000E1  00            	SMesc		.DB
350
 2926
351
 2927  0000E2                	SMXTmp:		.DS	26	; 26 bytes tmp
352
 2928
353
 2929          0000E2        	SMTmp2		.EQU	SMXTmp
354
 2930          0000E4        	SMTmp3		.EQU	SMXTmp+2
355
 2931          0000E6        	SMdwTmp1	.EQU	SMXTmp+4
356
 2932          0000EA        	SMdwTmp2	.EQU	SMXTmp+8
357
 2933          0000EE        	SMFsrc		.EQU	SMXTmp+12	; source bank for flash update
358
 2934          0000EF        	SMFflag		.EQU	SMXTmp+13	; flag file for flash update
359
 2935          0000F0        	SMXPos2		.EQU	SMXTmp+14
360
 2936          0000F1        	SMYPos2		.EQU	SMXTmp+15
361
 2937          0000F2        	SMXPos3		.EQU	SMXTmp+16
362
 2938          0000F3        	SMYPos3		.EQU	SMXTmp+17
363
 2939                        	;SMAuxL		.EQU	SMXTmp+18
364
 2940                        	;SMAuxH		.EQU	SMXTmp+19
365
 2941          0000F6        	SMXPos		.EQU	SMXTmp+20
366
 2942          0000F7        	SMYPos		.EQU	SMXTmp+21
367
 2943          0000F8        	SMdwTmp3	.EQU	SMXTmp+22
368
 2944
369
 2945          0000E2        	atcmd		.EQU	SMXTmp		; save @ command
370
 2946          0000E3        	atnum		.EQU	SMXTmp+1	; @ command index
371
 2947          0000E4        	atflag		.EQU	SMXTmp+2	; @ L,S,V,R,W start address flag
372
 2948          0000E5        	atbnk		.EQU	SMXTmp+3	; @ L,S,V,R,W bank
373
  Tue Jul 17 11:00:17 2018                                                                                               Page    7
374
 
375
 
376
 
377
 
378
 2949          0000E6        	atstr		.EQU	SMXTmp+4	; @ command string start (word)
379
 2950          0000E8        	atstart		.EQU	SMXTmp+6	; @ L,S,V,R,W start address (word)
380
 2951          0000EA        	atend		.EQU	SMXTmp+8	; @ S,W end address (word)
381
 2952          0000EC        	atbuf		.EQU	SMXTmp+10	; @ local buffer pointer (word)
382
 2953          0000EE        	atipb		.EQU	SMXTmp+12	; @ bank of input buffer
383
 2954          0000EF        	atdir		.EQU	SMXTmp+13	; @ load dir flag
384
 2955          0000F0        	atptr		.EQU	SMXTmp+14	; @ load dir pointer (word)
385
 2956          0000F2        	atsiz		.EQU	SMXTmp+16	; @ buffer size (word)
386
 2957          0000F5        	atlp		.EQU	SMXTmp+19	; @ long pointer
387
 2958          0000F8        	atsa		.EQU	SMXTmp+22	; @ sa
388
 2959
389
 2960          0000E2        	btmpx		.EQU	SMXTmp		; asc2bin conversion
390
 2961          0000E3        	brtcsec		.EQU	SMXTmp+1
391
 2962          0000E4        	brtcmin		.EQU	SMXTmp+2
392
 2963          0000E5        	brtchour	.EQU	SMXTmp+3
393
 2964          0000E6        	brtcday		.EQU	SMXTmp+4
394
 2965          0000E7        	brtcmonth	.EQU	SMXTmp+5
395
 2966          0000E8        	brtcyear	.EQU	SMXTmp+6
396
 2967          0000E9        	brtcct		.EQU	SMXTmp+7
397
 2968
398
 2969
399
 2970  0000FC                		.RELATIVE
400
 2971
401
 2972                        		.ENDS
402
 2973
403
 2977                        	.LIST on
404
 2978  F8FFB1
405
 2979                        		.CODEF8
406
 2980
407
 2981                        		.EXTERN _ScnCharOut, _ScnCharIn, cinit, LF8Tst
408
 2982
409
 2983                        		.LONGA	off
410
 2984                        		.LONGI	off
411
 2985
412
 2986                        	;---------------------------------------------------------------------------
413
 2987                        	; system bios call interface
414
 2988                        	;---------------------------------------------------------------------------
415
 2989  F80200
416
 2990                        	;---------------------------------------------------------------------------
417
 2991
418
 2992                        	; tabella funzioni text char output
419
 2993  F80200                	TXTOTBL:
420
 2994  F80200  7502 3F02 3F02 		.DW	_KeybOut, _SerOut, _SerOut, _ScnOut, _PrnOut, _PrnOut
421
               4103 6D02 6D02
422
 2995
423
 2996                        	; tabella funzioni text char input
424
 2997  F8020C                	TXTITBL:
425
 2998  F8020C  FA03 3D02 3D02 		.DW	_KeybIn, _SerIn, _SerIn, _ScnIn, _PrnIn, _PrnIn
426
               2402 6902 6902
427
 2999
428
 3000                        	; tabella funzioni text string output
429
 3001  F80218                	TXTSTBL:
430
 3002  F80218  7502 4C02 4C02 		.DW	_KeybOut, _SerStrOut, _SerStrOut, $0000
431
               0000
432
 3003  F80220  7102 7102     		.DW	_PrnStrOut, _PrnStrOut
433
 3004
434
 3005
435
  Tue Jul 17 11:00:17 2018                                                                                               Page    8
436
 
437
 
438
 
439
 
440
 3006                        	;---------------------------------------------------------------------------
441
 3007                        	;---------------------------------------------------------------------------
442
 3008
443
 3009                        	; char in da schermo (rediretto)
444
 3010  F80224                	_ScnIn:
445
 3011                        		.LONGA	off
446
 3012                        		.LONGI	off
447
 3013  F80224
448
 3014                        		;lda	DflTxtIn
449
 3015  F80224  A9 03         		lda	#TXTD_SCN
450
 3016  F80226  F4 00 01      		pea	#DP01ADDR	; imposta nuova DP
451
 3017  F80229  2B            		pld
452
 3018  F8022A  05 A1         		ora	ScnCR		; input rediretto da video
453
 3019  F8022C  85 A1         		sta	ScnCR
454
 3020  F8022E  A5 94         		lda	ScnRow
455
 3021  F80230  85 6E         		sta	ScnLinTmp
456
 3022  F80232  A5 91         		lda	ScnRight
457
 3023  F80234  85 97         		sta	ScnInput
458
 3024  F80236  20 D5 A4      		jsr	_ScnCharIn
459
 3025  F80239  83 0D         		sta	STKCR,s
460
 3026  F8023B  18            		clc
461
 3027  F8023C  6B            		rtl
462
 3028  F8023D
463
 3029                        	; char in da porta seriale
464
 3030  F8023D                	_SerIn:
465
 3031  F8023D  38            		sec
466
 3032  F8023E  6B            		rtl
467
 3033
468
 3034                        	; char out su porta seriale
469
 3035  F8023F                	_SerOut:
470
 3036                        		.EXTERN _spput0
471
 3037                        		.EXTERN lspput2
472
 3038  F8023F
473
 3039  F8023F  A6 50         		ldx	DflTxtOut
474
 3040  F80241  CA            		dex
475
 3041                        	?02:	;jsr	_spput0
476
 3042
477
 3043  F80242  22 66 0D F8   		jsl	lspput2
478
 3044  F80246  90 03         		bcc	?10
479
 3045  F80248  C8            		iny
480
 3046  F80249  D0 F7         		bne	?02
481
 3047  F8024B  6B            	?10:	rtl
482
 3048
483
 3049                        	; string out su porta seriale
484
 3050  F8024C                	_SerStrOut:
485
 3051  F8024C  A6 50         		ldx	DflTxtOut
486
 3052  F8024E  CA            		dex
487
 3053  F8024F  A7 51         	?02:	lda	[COPPtr]
488
 3054  F80251  F0 15         		beq	?20
489
 3055  F80253  20 08 05      	?05:	jsr	_spput0
490
 3056  F80256  90 04         		bcc	?10
491
 3057  F80258  C8            		iny
492
 3058  F80259  D0 F8         		bne	?05
493
 3059  F8025B  6B            		rtl
494
 3060  F8025C  C6 BC         	?10:	dec	coptmp
495
 3061  F8025E  F0 08         		beq	?20
496
 3062  F80260  E6 51         		inc	COPPtr
497
  Tue Jul 17 11:00:17 2018                                                                                               Page    9
498
 
499
 
500
 
501
 
502
 3063  F80262  D0 EB         		bne	?02
503
 3064  F80264  E6 52         		inc	COPPtr+1
504
 3065  F80266  80 E7         		bra	?02
505
 3066  F80268  6B            	?20:	rtl
506
 3067
507
 3068                        	; char in da porta LPT - errore permanente
508
 3069  F80269                	_PrnIn:
509
 3070  F80269                		CPU08
510
 3071  F80269  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
511
 3072                        		.LONGA	off
512
 3073                        		.LONGI	off
513
 3074                        		.MNLIST
514
 3075  F8026B  38            		sec
515
 3076  F8026C  6B            		rtl
516
 3077
517
 3078                        	; char out su porta LPT
518
 3079  F8026D                	_PrnOut:
519
 3080  F8026D                		CPU08
520
 3081  F8026D  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
521
 3082                        		.LONGA	off
522
 3083                        		.LONGI	off
523
 3084                        		.MNLIST
524
 3085  F8026F  38            		sec
525
 3086  F80270  6B            		rtl
526
 3087
527
 3088                        	; string out su porta LPT
528
 3089  F80271                	_PrnStrOut:
529
 3090  F80271                		CPU08
530
 3091  F80271  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
531
 3092                        		.LONGA	off
532
 3093                        		.LONGI	off
533
 3094                        		.MNLIST
534
 3095  F80273  38            		sec
535
 3096  F80274  6B            		rtl
536
 3097
537
 3098                        	; char out su tastiera - errore permanente
538
 3099  F80275                	_KeybOut:
539
 3100  F80275                		CPU08
540
 3101  F80275  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
541
 3102                        		.LONGA	off
542
 3103                        		.LONGI	off
543
 3104                        		.MNLIST
544
 3105  F80277  38            		sec
545
 3106  F80278  6B            		rtl
546
 3107  F80279
547
 3108  F80279                	COP_ScnPrint:
548
 3109                        		.GLOBAL COP_ScnPrint
549
 3110  F80279                		LONG_OFF
550
 3111                        		.LONGA	off
551
 3112                        		.LONGI	off
552
 3113                        		.MNLIST
553
 3114  F80279
554
 3115  F80279  A0 00         		ldy	#0		; indice stringa
555
 3116  F8027B                		CPU16
556
 3117  F8027B  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
557
 3118                        		.LONGA	on
558
 3119                        		.LONGI	on
559
  Tue Jul 17 11:00:17 2018                                                                                               Page   10
560
 
561
 
562
 
563
 
564
 3120                        		.MNLIST
565
 3121  F8027D  A9 00 01      		lda	#DP01ADDR	; imposta nuova DP
566
 3122  F80280  5B            		tcd
567
 3123  F80281  A3 10         		lda	STKPCL,s	; ricava ptr stringa
568
 3124  F80283  85 A2         		sta	ScnPrm
569
 3125  F80285                		ACC08			; A,M -> 8 bit
570
 3126  F80285  E2 20         		sep	#PMFLAG
571
 3127                        		.LONGA	off
572
 3128                        		.MNLIST
573
 3129  F80287  A3 12         		lda	STKPBR,s	; banco stringa
574
 3130  F80289  85 A4         		sta	ScnPrm+2
575
 3131  F8028B  64 B2         		stz	ScnFlag
576
 3132  F8028D  A9 40         		lda	#$40
577
 3133  F8028F  14 74         		trb	ScnAutoIns	; modo output
578
 3134  F80291  B7 A2         	?01:	lda	[ScnPrm],y	; loop
579
 3135  F80293  F0 0C         		beq	?02		; fine stringa
580
 3136  F80295  5A            		phy
581
 3137  F80296                		INDEX08
582
 3138  F80296  E2 10         		sep	#PXFLAG
583
 3139                        		.LONGI	off
584
 3140                        		.MNLIST
585
 3141  F80298  20 C1 AD      		jsr	_ScnCharOut
586
 3142  F8029B                		INDEX16
587
 3143  F8029B  C2 10         		rep	#PXFLAG
588
 3144                        		.LONGI	on
589
 3145                        		.MNLIST
590
 3146  F8029D  7A            		ply
591
 3147  F8029E  C8            		iny
592
 3148  F8029F  D0 F0         		bne	?01
593
 3149  F802A1                	?02:	CPU16
594
 3150  F802A1  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
595
 3151                        		.LONGA	on
596
 3152                        		.LONGI	on
597
 3153                        		.MNLIST
598
 3154  F802A3  C8            		iny
599
 3155  F802A4  98            		tya			; ptr terminatore stringa
600
 3156  F802A5  18            		clc
601
 3157  F802A6  65 A2         		adc	ScnPrm
602
 3158  F802A8  83 10         		sta	STKPCL,s	; update indirizzo di ritorno
603
 3159  F802AA                	RTL1:
604
 3160  F802AA                		CPU08
605
 3161  F802AA  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
606
 3162                        		.LONGA	off
607
 3163                        		.LONGI	off
608
 3164                        		.MNLIST
609
 3165  F802AC  18            		clc
610
 3166  F802AD  6B            		rtl
611
 3167
612
 3168  F802AE                	COP_TxtPrint:
613
 3169                        		.GLOBAL COP_TxtPrint
614
 3170  F802AE                		LONG_OFF
615
 3171                        		.LONGA	off
616
 3172                        		.LONGI	off
617
 3173                        		.MNLIST
618
 3174  F802AE
619
 3175  F802AE  A5 50         		lda	DflTxtOut
620
 3176  F802B0  C9 03         		cmp	#TXTD_SCN
621
  Tue Jul 17 11:00:17 2018                                                                                               Page   11
622
 
623
 
624
 
625
 
626
 3177  F802B2  F0 C5         		beq	COP_ScnPrint
627
 3178  F802B4  0A            		asl	a
628
 3179  F802B5  AA            		tax
629
 3180  F802B6  A0 00         		ldy	#0		; indice stringa
630
 3181  F802B8                		ACC16
631
 3182  F802B8  C2 20         		rep	#PMFLAG
632
 3183                        		.LONGA	on
633
 3184                        		.MNLIST
634
 3185  F802BA  A3 10         		lda	STKPCL,s	; ricava ptr stringa
635
 3186  F802BC  85 51         		sta	COPPtr
636
 3187  F802BE                		ACC08			; A,M -> 8 bit
637
 3188  F802BE  E2 20         		sep	#PMFLAG
638
 3189                        		.LONGA	off
639
 3190                        		.MNLIST
640
 3191  F802C0  A3 12         		lda	STKPBR,s	; banco stringa
641
 3192  F802C2  85 53         		sta	COPPtr+2
642
 3193  F802C4  B7 51         	?01:	lda	[COPPtr],y	; loop
643
 3194  F802C6  F0 03         		beq	?02		; fine stringa
644
 3195  F802C8  C8            		iny
645
 3196  F802C9  D0 F9         		bne	?01
646
 3197  F802CB                	?02:	CPU16
647
 3198  F802CB  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
648
 3199                        		.LONGA	on
649
 3200                        		.LONGI	on
650
 3201                        		.MNLIST
651
 3202  F802CD  C8            		iny			; skip final NUL
652
 3203  F802CE  98            		tya			; ptr terminatore stringa
653
 3204  F802CF  18            		clc
654
 3205  F802D0  65 51         		adc	COPPtr
655
 3206  F802D2  83 10         		sta	STKPCL,s	; update indirizzo di ritorno
656
 3207  F802D4                		CPU08
657
 3208  F802D4  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
658
 3209                        		.LONGA	off
659
 3210                        		.LONGI	off
660
 3211                        		.MNLIST
661
 3212  F802D6  88            		dey			; string length
662
 3213  F802D7  F0 D1         		beq	RTL1		; exit if empty
663
 3214  F802D9  84 BC         		sty	coptmp
664
 3215  F802DB  7C 18 02      		jmp	(TXTSTBL,x)
665
 3216  F802DE
666
 3217  F802DE
667
 3218                        	; output stringa a video
668
 3219                        	;In	- A offset stringa (16 bit)
669
 3220                        	;	  X banco stringa (8 bit)
670
 3221                        	; registri tutti preservati
671
 3222  F802DE                	COP_ScnStrOut:
672
 3223                        		.GLOBAL COP_ScnStrOut
673
 3224  F802DE                		LONG_OFF
674
 3225                        		.LONGA	off
675
 3226                        		.LONGI	off
676
 3227                        		.MNLIST
677
 3228
678
 3229  F802DE  A0 00         		ldy	#0
679
 3230  F802E0                		CPU16
680
 3231  F802E0  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
681
 3232                        		.LONGA	on
682
 3233                        		.LONGI	on
683
  Tue Jul 17 11:00:17 2018                                                                                               Page   12
684
 
685
 
686
 
687
 
688
 3234                        		.MNLIST
689
 3235  F802E2  A9 00 01      		lda	#DP01ADDR	; imposta nuova DP
690
 3236  F802E5  5B            		tcd
691
 3237  F802E6  A3 0D         		lda	STKCR,s		; ricava ptr stringa
692
 3238  F802E8  85 A2         		sta	ScnPrm
693
 3239  F802EA                		ACC08			; A,M -> 8 bit
694
 3240  F802EA  E2 20         		sep	#PMFLAG
695
 3241                        		.LONGA	off
696
 3242                        		.MNLIST
697
 3243  F802EC  A3 0B         		lda	STKXR,s		; banco stringa
698
 3244  F802EE  85 A4         		sta	ScnPrm+2
699
 3245  F802F0  64 B2         		stz	ScnFlag
700
 3246  F802F2  A9 40         		lda	#$40
701
 3247  F802F4  14 74         		trb	ScnAutoIns	; modo output
702
 3248  F802F6  B7 A2         	?01:	lda	[ScnPrm],y	; loop
703
 3249  F802F8  F0 0C         		beq	?02		; fine stringa
704
 3250  F802FA  5A            		phy
705
 3251  F802FB                		INDEX08
706
 3252  F802FB  E2 10         		sep	#PXFLAG
707
 3253                        		.LONGI	off
708
 3254                        		.MNLIST
709
 3255  F802FD  20 C1 AD      		jsr	_ScnCharOut
710
 3256  F80300                		INDEX16
711
 3257  F80300  C2 10         		rep	#PXFLAG
712
 3258                        		.LONGI	on
713
 3259                        		.MNLIST
714
 3260  F80302  7A            		ply
715
 3261  F80303  C8            		iny
716
 3262  F80304  D0 F0         		bne	?01
717
 3263  F80306                	?02:	CPU08
718
 3264  F80306  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
719
 3265                        		.LONGA	off
720
 3266                        		.LONGI	off
721
 3267                        		.MNLIST
722
 3268  F80308  18            		clc
723
 3269  F80309  6B            		rtl
724
 3270
725
 3271  F8030A                	COP_TxtStrOut:
726
 3272                        		.GLOBAL COP_TxtStrOut
727
 3273  F8030A                		LONG_OFF
728
 3274                        		.LONGA	off
729
 3275                        		.LONGI	off
730
 3276                        		.MNLIST
731
 3277  F8030A
732
 3278  F8030A  A5 50         		lda	DflTxtOut
733
 3279  F8030C  C9 03         		cmp	#TXTD_SCN
734
 3280  F8030E  F0 CE         		beq	COP_ScnStrOut
735
 3281  F80310  0A            		asl	a
736
 3282  F80311  AA            		tax
737
 3283  F80312  A0 00         		ldy	#0		; indice stringa
738
 3284  F80314                		ACC16
739
 3285  F80314  C2 20         		rep	#PMFLAG
740
 3286                        		.LONGA	on
741
 3287                        		.MNLIST
742
 3288  F80316  A3 10         		lda	STKPCL,s	; ricava ptr stringa
743
 3289  F80318  85 51         		sta	COPPtr
744
 3290  F8031A                		ACC08			; A,M -> 8 bit
745
  Tue Jul 17 11:00:17 2018                                                                                               Page   13
746
 
747
 
748
 
749
 
750
 3291  F8031A  E2 20         		sep	#PMFLAG
751
 3292                        		.LONGA	off
752
 3293                        		.MNLIST
753
 3294  F8031C  A3 12         		lda	STKPBR,s	; banco stringa
754
 3295  F8031E  85 53         		sta	COPPtr+2
755
 3296  F80320  B7 51         	?01:	lda	[COPPtr],y	; loop
756
 3297  F80322  F0 03         		beq	?02		; fine stringa
757
 3298  F80324  C8            		iny
758
 3299  F80325  D0 F9         		bne	?01
759
 3300  F80327  C8            	?02:	iny			; skip final NUL
760
 3301  F80328  88            		dey			; string length
761
 3302  F80329  F0 14         		beq	RTL2		; exit if empty
762
 3303  F8032B  84 BC         		sty	coptmp
763
 3304  F8032D  7C 18 02      		jmp	(TXTSTBL,x)
764
 3305  F80330
765
 3306                        	; Output carattere a schermo
766
 3307  F80330                	COP_ScnCharOut:
767
 3308                        		.GLOBAL COP_ScnCharOut
768
 3309  F80330                		LONG_OFF
769
 3310                        		.LONGA	off
770
 3311                        		.LONGI	off
771
 3312                        		.MNLIST
772
 3313
773
 3314  F80330  F4 00 01      		pea	#DP01ADDR	; imposta nuova DP
774
 3315  F80333  2B            		pld
775
 3316  F80334  A9 40         		lda	#$40
776
 3317  F80336  14 74         		trb	ScnAutoIns	; modo output
777
 3318  F80338  A3 0D         		lda	STKCR,s
778
 3319  F8033A                	COP?01:
779
 3320  F8033A  64 B2         		stz	ScnFlag
780
 3321  F8033C  20 C1 AD      		jsr	_ScnCharOut
781
 3322  F8033F                	RTL2:
782
 3323  F8033F  18            		clc			; no error
783
 3324  F80340  6B            		rtl
784
 3325
785
 3326  F80341                	_ScnOut:
786
 3327  F80341  F4 00 01      		pea	#DP01ADDR	; imposta nuova DP
787
 3328  F80344  2B            		pld
788
 3329  F80345  AA            		tax
789
 3330  F80346  A9 40         		lda	#$40
790
 3331  F80348  14 74         		trb	ScnAutoIns	; modo output
791
 3332  F8034A  8A            		txa
792
 3333  F8034B  80 ED         		bra	COP?01
793
 3334  F8034D
794
 3335  F8034D                	COP_ScnPrChar:
795
 3336                        		.GLOBAL COP_ScnPrChar
796
 3337  F8034D                		LONG_OFF
797
 3338                        		.LONGA	off
798
 3339                        		.LONGI	off
799
 3340                        		.MNLIST
800
 3341  F8034D
801
 3342  F8034D                		ACC16
802
 3343  F8034D  C2 20         		rep	#PMFLAG
803
 3344                        		.LONGA	on
804
 3345                        		.MNLIST
805
 3346  F8034F  A9 00 01      		lda	#DP01ADDR	; imposta nuova DP
806
 3347  F80352  5B            		tcd
807
  Tue Jul 17 11:00:17 2018                                                                                               Page   14
808
 
809
 
810
 
811
 
812
 3348  F80353  A3 10         		lda	STKPCL,s	; ricava ptr stringa
813
 3349  F80355  85 A2         		sta	ScnPrm
814
 3350  F80357  1A            		inc	a		; update return address
815
 3351  F80358  83 10         		sta	STKPCL,s
816
 3352  F8035A                		ACC08			; A,M -> 8 bit
817
 3353  F8035A  E2 20         		sep	#PMFLAG
818
 3354                        		.LONGA	off
819
 3355                        		.MNLIST
820
 3356  F8035C  A3 12         		lda	STKPBR,s	; banco stringa
821
 3357  F8035E  85 A4         		sta	ScnPrm+2
822
 3358  F80360  A9 40         		lda	#$40
823
 3359  F80362  14 74         		trb	ScnAutoIns	; modo output
824
 3360  F80364  A7 A2         		lda	[ScnPrm]	; char to print
825
 3361  F80366  80 D2         		bra	COP?01
826
 3362
827
 3363  F80368                	COP_TxtCharOut:
828
 3364                        		.GLOBAL COP_TxtCharOut
829
 3365  F80368                		LONG_OFF
830
 3366                        		.LONGA	off
831
 3367                        		.LONGI	off
832
 3368                        		.MNLIST
833
 3369  F80368
834
 3370  F80368  A5 50         		lda	DflTxtOut
835
 3371  F8036A  0A            		asl	a
836
 3372  F8036B  AA            		tax
837
 3373  F8036C  A3 0D         		lda	STKCR,s
838
 3374  F8036E  7C 00 02      		jmp	(TXTOTBL,x)
839
 3375
840
 3376  F80371                	COP_DevCharOut:
841
 3377                        		.GLOBAL COP_DevCharOut
842
 3378  F80371                		LONG_OFF
843
 3379                        		.LONGA	off
844
 3380                        		.LONGI	off
845
 3381                        		.MNLIST
846
 3382  F80371
847
 3383  F80371  A3 0E         		lda	STKCR+1,s	; # device
848
 3384  F80373  A8            		tay
849
 3385  F80374  0A            		asl	a
850
 3386  F80375  AA            		tax
851
 3387  F80376  A3 0D         		lda	STKCR,s		; character
852
 3388  F80378  7C 00 02      		jmp	(TXTOTBL,x)
853
 3389
854
 3390  F8037B                	COP_TxtPrChar:
855
 3391                        		.GLOBAL COP_TxtPrChar
856
 3392  F8037B                		LONG_OFF
857
 3393                        		.LONGA	off
858
 3394                        		.LONGI	off
859
 3395                        		.MNLIST
860
 3396  F8037B
861
 3397  F8037B                		ACC16
862
 3398  F8037B  C2 20         		rep	#PMFLAG
863
 3399                        		.LONGA	on
864
 3400                        		.MNLIST
865
 3401  F8037D  A3 10         		lda	STKPCL,s	; ricava ptr stringa
866
 3402  F8037F  85 51         		sta	COPPtr
867
 3403  F80381  1A            		inc	a		; update return address
868
 3404  F80382  83 10         		sta	STKPCL,s
869
  Tue Jul 17 11:00:17 2018                                                                                               Page   15
870
 
871
 
872
 
873
 
874
 3405  F80384                		ACC08			; A,M -> 8 bit
875
 3406  F80384  E2 20         		sep	#PMFLAG
876
 3407                        		.LONGA	off
877
 3408                        		.MNLIST
878
 3409  F80386  A3 12         		lda	STKPBR,s	; banco stringa
879
 3410  F80388  85 53         		sta	COPPtr+2
880
 3411  F8038A  A5 50         		lda	DflTxtOut
881
 3412  F8038C  0A            		asl	a
882
 3413  F8038D  AA            		tax
883
 3414  F8038E  A7 51         		lda	[COPPtr]	; char to print
884
 3415  F80390  7C 00 02      		jmp	(TXTOTBL,x)
885
 3416
886
 3417  F80393                	COP_ScnPasStr:
887
 3418                        		.GLOBAL COP_ScnPasStr
888
 3419  F80393                		LONG_OFF
889
 3420                        		.LONGA	off
890
 3421                        		.LONGI	off
891
 3422                        		.MNLIST
892
 3423
893
 3424  F80393                		CPU16
894
 3425  F80393  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
895
 3426                        		.LONGA	on
896
 3427                        		.LONGI	on
897
 3428                        		.MNLIST
898
 3429  F80395  A9 00 01      		lda	#DP01ADDR	; imposta nuova DP
899
 3430  F80398  5B            		tcd
900
 3431  F80399  A3 0D         		lda	STKCR,s		; ricava ptr stringa
901
 3432  F8039B  85 A2         		sta	ScnPrm
902
 3433  F8039D                		CPU08			; A,M -> 8 bit
903
 3434  F8039D  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
904
 3435                        		.LONGA	off
905
 3436                        		.LONGI	off
906
 3437                        		.MNLIST
907
 3438  F8039F  A3 0B         		lda	STKXR,s		; banco stringa
908
 3439  F803A1  85 A4         		sta	ScnPrm+2
909
 3440  F803A3  A9 00         		lda	#0
910
 3441  F803A5  85 B2         		sta	ScnFlag
911
 3442  F803A7  EB            		xba			; B = 0
912
 3443  F803A8  A9 40         		lda	#$40
913
 3444  F803AA  14 74         		trb	ScnAutoIns	; modo output
914
 3445  F803AC  A7 A2         		lda	[ScnPrm]	; str len
915
 3446  F803AE  A0 01         		ldy	#1		; first index
916
 3447  F803B0                		CPU16
917
 3448  F803B0  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
918
 3449                        		.LONGA	on
919
 3450                        		.LONGI	on
920
 3451                        		.MNLIST
921
 3452  F803B2
922
 3453  F803B2                	_ScnBufOut:
923
 3454  F803B2  AA            		tax			; buf len
924
 3455  F803B3  F0 13         		beq	?02
925
 3456  F803B5                		ACC08
926
 3457  F803B5  E2 20         		sep	#PMFLAG
927
 3458                        		.LONGA	off
928
 3459                        		.MNLIST
929
 3460  F803B7  B7 A2         	?01:	lda	[ScnPrm],y	; loop
930
 3461  F803B9  DA            		phx
931
  Tue Jul 17 11:00:17 2018                                                                                               Page   16
932
 
933
 
934
 
935
 
936
 3462  F803BA  5A            		phy
937
 3463  F803BB                		INDEX08
938
 3464  F803BB  E2 10         		sep	#PXFLAG
939
 3465                        		.LONGI	off
940
 3466                        		.MNLIST
941
 3467  F803BD  20 C1 AD      		jsr	_ScnCharOut
942
 3468  F803C0                		INDEX16
943
 3469  F803C0  C2 10         		rep	#PXFLAG
944
 3470                        		.LONGI	on
945
 3471                        		.MNLIST
946
 3472  F803C2  7A            		ply
947
 3473  F803C3  FA            		plx
948
 3474  F803C4  C8            		iny
949
 3475  F803C5  CA            		dex
950
 3476  F803C6  D0 EF         		bne	?01
951
 3477  F803C8                	?02:	CPU08
952
 3478  F803C8  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
953
 3479                        		.LONGA	off
954
 3480                        		.LONGI	off
955
 3481                        		.MNLIST
956
 3482  F803CA  18            		clc
957
 3483  F803CB  6B            		rtl
958
 3484
959
 3485  F803CC                	COP_TxtPasStr:
960
 3486                        		.GLOBAL COP_TxtPasStr
961
 3487  F803CC                		LONG_OFF
962
 3488                        		.LONGA	off
963
 3489                        		.LONGI	off
964
 3490                        		.MNLIST
965
 3491
966
 3492  F803CC  A5 50         		lda	DflTxtOut
967
 3493  F803CE  C9 03         		cmp	#TXTD_SCN
968
 3494  F803D0  F0 C1         		beq	COP_ScnPasStr
969
 3495  F803D2  38            		sec
970
 3496  F803D3  6B            		rtl
971
 3497
972
 3498  F803D4                	COP_ScnBufOut:
973
 3499                        		.GLOBAL COP_ScnBufOut
974
 3500  F803D4                		LONG_OFF
975
 3501                        		.LONGA	off
976
 3502                        		.LONGI	off
977
 3503                        		.MNLIST
978
 3504
979
 3505  F803D4  A0 00         		ldy	#0		; first index
980
 3506  F803D6                		CPU16
981
 3507  F803D6  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
982
 3508                        		.LONGA	on
983
 3509                        		.LONGI	on
984
 3510                        		.MNLIST
985
 3511  F803D8  A9 00 01      		lda	#DP01ADDR	; imposta nuova DP
986
 3512  F803DB  5B            		tcd
987
 3513  F803DC  A3 0D         		lda	STKCR,s		; ricava ptr stringa
988
 3514  F803DE  85 A2         		sta	ScnPrm
989
 3515  F803E0                		CPU08			; A,M -> 8 bit
990
 3516  F803E0  E2 30         		sep	#(PMFLAG.OR.PXFLAG)
991
 3517                        		.LONGA	off
992
 3518                        		.LONGI	off
993
  Tue Jul 17 11:00:17 2018                                                                                               Page   17
994
 
995
 
996
 
997
 
998
 3519                        		.MNLIST
999
 3520  F803E2  A3 0B         		lda	STKXR,s		; banco stringa
1000
 3521  F803E4  85 A4         		sta	ScnPrm+2
1001
 3522  F803E6  64 B2         		stz	ScnFlag
1002
 3523  F803E8  A9 40         		lda	#$40
1003
 3524  F803EA  14 74         		trb	ScnAutoIns	; modo output
1004
 3525  F803EC                		CPU16
1005
 3526  F803EC  C2 30         		rep	#(PMFLAG.OR.PXFLAG)
1006
 3527                        		.LONGA	on
1007
 3528                        		.LONGI	on
1008
 3529                        		.MNLIST
1009
 3530  F803EE  A3 09         		lda	STKYR,s		; buf len
1010
 3531  F803F0  80 C0         		bra	_ScnBufOut
1011
 3532  F803F2                		LONG_OFF
1012
 3533                        		.LONGA	off
1013
 3534                        		.LONGI	off
1014
 3535                        		.MNLIST
1015
 3536  F803F2
1016
 3537  F803F2                	COP_TxtBufOut:
1017
 3538                        		.GLOBAL COP_TxtBufOut
1018
 3539  F803F2                		LONG_OFF
1019
 3540                        		.LONGA	off
1020
 3541                        		.LONGI	off
1021
 3542                        		.MNLIST
1022
 3543
1023
 3544  F803F2  A5 50         		lda	DflTxtOut
1024
 3545  F803F4  C9 03         		cmp	#TXTD_SCN
1025
 3546  F803F6  F0 DC         		beq	COP_ScnBufOut
1026
 3547  F803F8  38            		sec
1027
 3548  F803F9  6B            		rtl
1028
 3549  F803FA
1029
 3550  F803FA                	COP_KbCharIn:
1030
 3551                        		.GLOBAL COP_KbCharIn
1031
 3552
1032
 3553                        	; char in da tastiera
1033
 3554  F803FA                	_KeybIn:
1034
 3555                        		.LONGA	off
1035
 3556                        		.LONGI	off
1036
 3557
1037
 3558  F803FA  F4 00 01      		pea	#DP01ADDR	; imposta nuova DP
1038
 3559  F803FD  2B            		pld
1039
 3560  F803FE  A5 95         		lda	ScnCol		; input tastiera - full editor
1040
 3561  F80400  85 98         		sta	ScnColStart
1041
 3562  F80402  A5 94         		lda	ScnRow
1042
 3563  F80404  85 96         		sta	ScnRowStart
1043
 3564  F80406  20 D5 A4      		jsr	_ScnCharIn
1044
 3565  F80409  83 0D         		sta	STKCR,s
1045
 3566  F8040B  18            		clc
1046
 3567  F8040C  6B            		rtl
1047
 3568
1048
 3569  F8040D                	COP_TxtCharIn:
1049
 3570                        		.GLOBAL COP_TxtCharIn
1050
 3571                        		.LONGA	off
1051
 3572                        		.LONGI	off
1052
 3573
1053
 3574  F8040D  A5 4F         		lda	DflTxtIn
1054
 3575  F8040F  0A            		asl	a
1055
  Tue Jul 17 11:00:17 2018                                                                                               Page   18
1056
 
1057
 
1058
 
1059
 
1060
 3576  F80410  AA            		tax
1061
 3577  F80411  7C 0C 02      		jmp	(TXTITBL,x)
1062
 3578
1063
 3579  F80414                	COP_DevCharIn:
1064
 3580                        		.GLOBAL COP_DevCharIn
1065
 3581                        		.LONGA	off
1066
 3582                        		.LONGI	off
1067
 3583
1068
 3584  F80414  A3 0D         		lda	STKCR,s		; device
1069
 3585  F80416  A8            		tay
1070
 3586  F80417  0A            		asl	a
1071
 3587  F80418  AA            		tax
1072
 3588  F80419  7C 0C 02      		jmp	(TXTITBL,x)
1073
 3589
1074
 3590  F8041C                	COP_ScnXchg:
1075
 3591                        		.GLOBAL COP_ScnXchg
1076
 3592  F8041C                		LONG_OFF
1077
 3593                        		.LONGA	off
1078
 3594                        		.LONGI	off
1079
 3595                        		.MNLIST
1080
 3596  F8041C
1081
 3597  F8041C  F4 00 01      		pea	#DP01ADDR	; imposta nuova DP
1082
 3598  F8041F  2B            		pld
1083
 3599  F80420  A3 0D         		lda	STKCR,s		; A = 0..1
1084
 3600  F80422  D0 08         		bne	?04		; switch to VGA
1085
 3601  F80424  A5 6D         		lda	VBBRam
1086
 3602  F80426  10 13         		bpl	?10		; already PAL -- exit
1087
 3603  F80428  64 6D         		stz	VBBRam
1088
 3604  F8042A  80 0C         		bra	?08
1089
 3605  F8042C  24 6D         	?04:	bit	VBBRam
1090
 3606  F8042E  30 0B         		bmi	?10		; already VGA -- exit
1091
 3607  F80430  24 6C         		bit	VBBFlag		; VGA installed?
1092
 3608  F80432  10 07         		bpl	?10		; no
1093
 3609  F80434  A9 80         		lda	#$80
1094
 3610  F80436  85 6D         		sta	VBBRam
1095
 3611  F80438  20 08 A3      	?08:	jsr	cinit
1096
 3612  F8043B  18            	?10:	clc
1097
 3613  F8043C  6B            		rtl
1098
 3614  F8043D
1099
 3615  F8043D                	sys_tasksw:
1100
 3616  F8043D
1101
 3617                        		.PUBLIC sys_tasksw
1102
 3618
1103
 3619  F8043D                		ACC16			; retrieve subfunction number
1104
 3620  F8043D  C2 20         		rep	#PMFLAG
1105
 3621                        		.LONGA	on
1106
 3622                        		.MNLIST
1107
 3623  F8043F  A3 10         		lda	STKPCL,s	; pointer to byte after signature
1108
 3624  F80441  85 51         		sta	COPPtr
1109
 3625  F80443  1A            		inc	a		; update return address
1110
 3626  F80444  83 10         		sta	STKPCL,s
1111
 3627  F80446                		ACC08			; A,M -> 8 bit
1112
 3628  F80446  E2 20         		sep	#PMFLAG
1113
 3629                        		.LONGA	off
1114
 3630                        		.MNLIST
1115
 3631  F80448  A3 12         		lda	STKPBR,s	; bank where was executed cop instruction
1116
 3632  F8044A  85 53         		sta	COPPtr+2
1117
  Tue Jul 17 11:00:17 2018                                                                                               Page   19
1118
 
1119
 
1120
 
1121
 
1122
 3633  F8044C  A7 51         		lda	[COPPtr]	; byte after signature
1123
 3634  F8044E  F0 04         		beq	?80
1124
 3635                        		;bcc	?02		; ok
1125
 3636  F80450  38            		sec
1126
 3637  F80451  A9 01         		lda	#EINV		; error
1127
 3638  F80453  6B            		rtl
1128
 3639
1129
 3640  F80454  20 8B 1E      	?80:	jsr	LF8Tst
1130
 3641  F80457  18            		clc
1131
 3642  F80458  6B            		rtl
1132
 3643
1133
 3644
1134
 3645  F80459                	sys_mkfs:
1135
 3646                        		.PUBLIC sys_mkfs
1136
 3647
1137
 3648  F80459  18            		clc
1138
 3649  F8045A  6B            		rtl
1139
 
1140
 
1141
             Lines Assembled : 3464                  Errors : 0
1142
 
1143
 
1144