0100 ;sparky.m65 0110 ;Bill Aycock 3-87 0120 ; 0130 ; 0140 ;Allow a SpartaDOS command-line 0150 ;argument for the extension of 0160 ;the PFKEYS macro definition 0170 ;file for SuperKEY! to load 0180 ;(i.e. use PFKEYS.xxx) 0190 ; 0200 ; 0210 ;The original SUPKEY.COM had a 0220 ;separate segment with the 0230 ;starting RTS to avoid re-entry 0240 ;but I've moved that to be the 0250 ;first byte of the SUPKEY code. 0260 ; 0270 ;What was originally an INIT 0280 ;vector I have changed to a 0290 ;RUN vector; that way, I can 0300 ;use the INIT vector for my 0310 ;code. 0320 ; 0330 ;Current values: 0340 ; 0350 ; SUPKEY start: $51D2 0360 ; end: $54BB 0370 ; SPARKY start: $54BC 0380 ; end: $5515 0390 ; run vector: $52F3 0400 ; init vector: $54DE 0410 ; 0420 ; 0430 ;If you have any questions, 0440 ;contact me at 76703,4061. 0450 ; 0460 ; 0470 ;------------------------------ 0480 ; 0490 ;start code right after SUPKEY 0500 ;so it is all in one segment 0510 ; 0520 ; 0530 *= $54BC 0540 ; 0550 ; 0560 ;------------------------------ 0570 ; 0580 ; --- E Q U A T E S --- 0590 ; 0600 ; 0610 ZCR .WORD 0 ;get an arg 0620 CFN .WORD 0 ;arg buffer 0630 SAV .WORD 0 ;save ptr 0640 PTR = $A0 ;use as pointer 0650 DOSVEC = $0A ;addr of COMTAB 0660 FN = $53CA ;PFKEYS ext 0670 NOTOK = $5498 ;not-ok msg 0680 ; 0690 ; 0700 ;------------------------------ 0710 ; 0720 FIXPTRS 0730 ; 0740 ;Set up zcr and cfn to point to 0750 ;SpartaDOS's get-an-arg routine 0760 ;(ZCRNAME) and argument buffer 0770 ;(COMFNAM). We will skip 3 bytes 0780 ;of COMFNAM since ZCRNAME always 0790 ;adds a device spec to an arg. 0800 ; 0810 ; 0820 LDA DOSVEC+1 ;zcr=comtab+3 0830 STA ZCR+1 0840 LDA DOSVEC 0850 CLC 0860 ADC #3 0870 BCC OK1 0880 INC ZCR+1 0890 OK1 0900 STA ZCR 0910 ; 0920 LDA DOSVEC+1 ;cfn=comtab+33 0930 STA CFN+1 0940 LDA DOSVEC 0950 CLC 0960 ADC #36 ;skip 3 extra 0970 BCC OK2 0980 INC CFN 0990 OK2 1000 STA CFN 1010 RTS 1020 ; 1030 ; 1040 ;------------------------------ 1050 ; 1060 CALLZ 1070 ; 1080 ;fake an indirect JSR (ZCRNAME) 1090 ;by using JSR CALLZ 1100 ; 1110 ; 1120 JMP (ZCR) 1130 ; 1140 ; 1150 ;------------------------------- 1160 ; 1170 FIXEXT 1180 ; 1190 ;Check for a PFKEYS extension 1200 ;on the cmd line, hack it 1210 ;into the SUPKEY code (just 1220 ;use '.DAT' if not found). 1230 ; 1240 JSR FIXPTRS 1250 JSR CALLZ 1260 BEQ QUIT ;z set=no args 1270 ; 1280 LDA PTR ;save ptr val 1290 STA SAV 1300 LDA PTR+1 1310 STA SAV+1 1320 LDA CFN ;set up pointer 1330 STA PTR 1340 LDA CFN+1 1350 STA PTR+1 1360 ; 1370 LDY #0 1380 MORE 1390 LDA (PTR),Y ;get the ext and 1400 STA FN,Y ;hack the bytes 1410 STA NOTOK,Y 1420 INY 1430 CPY #3 ;just 3 bytes 1440 BNE MORE 1450 QUIT 1460 RTS 1470 ; 1480 ; 1490 ;------------------------------ 1500 ; 1510 ;and finally the init vector 1520 ; 1530 *= $02E2 1540 ; 1550 INITVEC .WORD FIXEXT 1560 ; 1570 ;and that's all! 1580 ; 1590 .END 66666666666666666666666666666666666666666666666666666666666666666666666666