10
20
30 :
40 OSFIND=&FFCE:OSBGET=&FFD7:OSARGS=&FFDA
50 OSNEWL=&FFE7:OSWRCH=&FFEE:OSBYTE=&FFF4
60 lptr=&AE
70 lines=1
80 :
90 fname$="TxType"
100 load%=&FFFF0900
110 DIM mcode% &100
120 FOR P=0 TO 1
130 P%=load%:O%=mcode%
140 [OPT P*3+4
150 .errSyntax
160 BRK:EQUB 220:EQUS "Syntax: TxType <afsp>":BRK
170 :
180 .go%
190 LDX #lptr:LDY #0:LDA #1
200 JSR OSARGS:LDA (lptr),Y
210 CMP #13:BEQ errSyntax
220 LDX lptr+0:LDY lptr+1
230 LDA #&40:JSR OSFIND
240 TAY:BNE LoopStart
250 BRK:EQUB 214:EQUS "File not found":BRK
260 :
270 .LoopStart
280 LDX #&FC:STX lptr+1
290 LDX #&18+lines*40:STX lptr+0
300 .LoopMain
310 BIT &FF:BMI FileEnd
320 JSR OSBGET:BCS FileEnd
330 CMP #&20:BCC LoopSetTop
340 CMP #&23:BEQ LoopSetTop
350 CMP #&5F:BEQ LoopSetTop
360 CMP #&60:BEQ LoopSetTop
370 CMP #&7F:BEQ LoopSetTop
380 EOR #&80
390 .LoopSetTop
400 EOR #&80
410 JSR OSWRCH
420 INC lptr+0:BNE LoopMain
430 INC lptr+1:BNE LoopMain
440 .LoopSkip
450 JSR OSBGET:BCS FileEnd
460 DEX:BNE LoopSkip
470 BEQ LoopStart
480 :
490 .FileEnd
500 LDA #0:JSR OSFIND
510 LDA #124:JMP OSBYTE
520 :
530 ]NEXT
540 PRINT"*SAVE ";fname$;" ";~mcode%;" ";~O%;" ";~go%OR&FFFF0000;" ";~load%