> ADDCOM/S  *ADDCOM () : (mcode%=&FFFF0900 2OSFILE=&FFDD:OSFIND=&FFCE <OSBGET=&FFD7:OSARGS=&FFDA FAddr=&A8:Temp=&AA:Lptr=&AC P!InitAddr=&8040:NextAddr=&8043 ZSkipToCR=&8046 d P=0 1 n P%=mcode% x [OPT P*3 .Error ?BRK:EQUB 220:EQUS "Syntax: ADDCOM (-) ()" .FileNotFound &BRK:EQUB 214:EQUS "File not found" .BadRom #BRK:EQUB 254:EQUS "Bad ROM":BRK .start% LDA &F4:PHA %LDX #Lptr:LDY #0:LDA #1:JSR &FFDA "LDA (Lptr),Y:CMP #13:BEQ Error CMP #"-":BNE load_file INY:LDA (Lptr),Y:CMP #"A" BCC get_hex: #&DF:SBC #7  .get_hex  #15:STA &F4:STA &FE30:INY .load_file "LDA (Lptr),Y:INY:CMP #" " ,BEQ load_file:DEY 6!LDA &8040:CMP #&4C:BNE BadRom @TYA:CLC:ADC Lptr:STA Lptr J LDA Lptr+1:ADC #0:STA Lptr+1 TLDA Lptr:STA ctrl ^LDA Lptr+1:STA ctrl+1 h!LDX #ctrl 255:LDY #ctrl 256 rLDA #5:JSR OSFILE |CMP #1:BNE FileNotFound !LDA &8040:CMP #&4C:BNE BadRom JSR InitAddr .LookForEnd LDA (Addr),Y:BEQ EndFound JSR SkipToCR:JSR NextAddr BEQ LookForEnd  .EndFound LDA (Lptr),Y:STA (Addr),Y INY:CMP #13:BNE EndFound LDA ctrl+2:STA (Addr),Y:INY LDA ctrl+3:STA (Addr),Y:INY LDA ctrl+6:STA (Addr),Y:INY LDA ctrl+7:STA (Addr),Y:INY  LDA ctrl+10:STA (Addr),Y:INY  LDA ctrl+11:STA (Addr),Y:INY TYA:CLC:ADC Addr:STA Addr & LDA Addr+1:ADC #0:STA Addr+1 0 LDX ctrl:LDY ctrl+1:LDA #&40 : JSR OSFIND:STA Temp+1:LDY #0 D .LoadLoop NSTY Temp:LDY Temp+1 XJSR OSBGET:LDY Temp:BCS End b!STA (Addr),Y:INY:BNE LoadLoop lINC Addr+1:BNE LoadLoop v.End LDA #0:STA (Addr),Y LDY Temp+1:JSR OSFIND PLA:STA &F4:STA &FE30 RTS  .ctrl ] :"*SAVE ADDCOM ";~mcode%;" ";~P%;" ";~start%&FFFF0000