10
20
30
40
50
60
70
80 OSFILE=&FFDD:OSARGS=&FFDA:OSWRCH=&FFEE:OSNEWL=&FFE7
90 DIM mcode% &200:load%=&FFFF0900:zp=&A8
100 FOR P=0 TO 1
110 P%=load%:O%=mcode%
120 [OPT P*3+4
130 .ctrl:.syntax
140 BRK:EQUB 220:EQUS "Syntax: FInfo (-|=)<afsp>":BRK
150 .start%
160 LDA #1:LDY #0:LDX #zp:JSR OSARGS
170 LDA (zp),Y:CMP #13:BEQ syntax
180 CMP #ASC"=":BEQ info0:CMP #ASC"-":BNE info1
190 .info0
200 INC zp:BNE info2:INC zp+1:BNE info2
210 .info1
220 LDX #15:LDA #0:.loop0
230 STA ctrl+2,X:DEX:BPL loop0
240 .info2
250 PHA:LDA #5:JSR DoOsfile:PHA
260 LDA ctrl:STA zp:LDA ctrl+1:STA zp+1
270 LDY #0
280 .loop1
290 LDA (zp),Y:INY:CMP #ASC"!"
300 BCS loop1:DEY
310 .loop2
320 LDA (zp),Y:CMP #ASC".":BEQ info3
330 DEY:BNE loop2:DEY
340 .info3:INY:LDX #10
350 .loop3
360 LDA (zp),Y:CMP #ASC"!":BCC end1
370 JSR OSWRCH:DEX:INY:BNE loop3:.end1
380 JSR PrSpace:DEX:BPL end1
390 LDY #5:JSR pr_addr
400 JSR pr_addr:LDA ctrl+13:BEQ len2
410 JSR pr_addr:JMP len3
420 .len2:JSR Pr2Spaces
430 DEY:LDX #3:JSR pr_addrX:.len3
440 JSR Pr2Spaces
450 LDY #9:LDX #7:LDA ctrl+14
460 ROL A:ROL A:ROL A:ROL A:PHP
470 .loop4
480 PLP:ROL A:PHP:PHA:BCC noChar
490 LDA acc,X:JSR OSWRCH
500 DEY:.noChar:CPX #4:BNE Char2
510 PLA:PLP:ROL A:PHP:PHA:\ Lose extra bit
520 JSR PrSlash:.Char2
530 PLA:DEX:BPL loop4:PLP
540 .loop5:JSR PrSpace
550 DEY:BNE loop5
560 LDA ctrl+15:AND #31:JSR pr_dec:JSR PrSlash
570 LDA ctrl+16:AND #15:JSR pr_dec:JSR PrSlash
580 LDA ctrl+16:CLC:BEQ zero
590 LSR A:LSR A:LSR A:LSR A:STA zp
600 LDA ctrl+15:AND #&E0:LSR A:ORA zp
610 CLC:ADC #81
620 .zero:\ A=00 or 81....208
630 PHA:BEQ zero2
640 CMP #100:LDA #&19:BCC zero2:PLA:SBC #100:PHA:LDA #&20
650 .zero2:JSR PrHex
660 PLA:JSR pr_dec:JSR PrSpace
670 LDA ctrl+17:JSR PrHex:JSR PrSpace
680 PLA:PHA:JSR PrHex:JSR PrSpace
690 PLA:CLC:ADC #1:CMP #4:BCS exit
700 ASL A:ASL A:TAX:LDY #4
710 .loop6
720 LDA text,X:BEQ exit
730 JSR OSWRCH:INX:DEY:BNE loop6
740 .exit
750 PLA:CMP #ASC"=":BNE exit2
760 JSR PrSpace
770 LDA #&FD:JSR DoOsfile2
780 LDA ctrl+3:JSR PrHex
790 LDA ctrl+2:JSR PrHex:JSR PrSlash
800 LDY #5:LDX #2:JSR pr_addrX
810 LDA ctrl+17:JSR PrHex
820 LDA #ASC":":JSR OSWRCH
830 LDY #16:LDX #3:JSR pr_addrX
840 .exit2
850 :
860 JMP OSNEWL
870 :
880 .DoOsfile
890 LDX zp:LDY zp+1:STX ctrl:STY ctrl+1
900 .DoOsfile2
910 LDX #ctrl AND 255:LDY #ctrl DIV 256
920 JMP OSFILE
930 :
940 .pr_addr:LDX #4:.pr_addrX
950 TYA:PHA:.pr_addr1
960 LDA ctrl,Y:JSR PrHex
970 DEY:DEX:BNE pr_addr1
980 PLA:TAY:INY:INY:INY:INY
990 BNE PrSpace
1000 :
1010 .Pr4Spaces:JSR Pr2Spaces
1020 .Pr2Spaces:JSR PrSpace
1030 .PrSpace
1040 LDA #32:JMP OSWRCH
1050 .PrSlash
1060 LDA #ASC"/":JMP OSWRCH
1070 :
1080 .pr_dec
1090 \ First do BINtoBCD
1100 PHA:LDA #10:STA zp:PLA
1110 .BINtoBCDlp
1120 CMP zp:BCC BCDdone
1130 ADC #5:PHA
1140 LDA zp:ADC #16:STA zp
1150 PLA:BCC BINtoBCDlp
1160 .BCDdone
1170 \ Then fall through to PrHex
1180 .PrHex
1190 PHA:LSR A:LSR A:LSR A:LSR A
1200 JSR pr_nybble:PLA
1210 .pr_nybble
1220 AND #15:CMP #10:BCC pr_n2
1230 ADC #6:.pr_n2
1240 ADC #48:JMP OSWRCH
1250 .acc
1260 EQUS "RWEPRWEL"
1270 .text
1280 EQUS "Run":BRK
1290 EQUS "NFnd"
1300 EQUS "File"
1310 EQUS "Dir."
1320 EQUS "1.03"
1330 ]NEXT
1340 PRINT"*SAVE FInfo ";~mcode%;" ";~O%;" ";~start%OR&FFFF0000;" ";~load%