10 REM !------------------------------!›11 REM ! TURBOMOD.TUR BY SIZ 1991 !›12 REM !------------------------------!›13 REM ! This program reads in your !›14 REM ! Turbo-BASIC XL binary file !›15 REM ! and creates a new one that !›16 REM ! is compatible with some !›17 REM ! other MEMLO-changing devices !›18 REM ! including my 80:, M: and N: !›19 REM ! device handlers. This !›20 REM ! program supersedes 80TBMODI !›21 REM ! because the new binary file !›22 REM ! will now load correctly !›23 REM ! whether or not a low-memory !›24 REM ! device is used, there is no !›25 REM ! need to keep a separate copy !›26 REM ! of Turbo-BASIC XL. !›27 REM !------------------------------!›28 REM ›29 REM !------------------------------!›30 REM ! Read in the names of the !›31 REM ! input and output files. !›32 REM !------------------------------!›33 TRAP #ERROR›34 DIM IN$(20),OUT$(20),BUFFER$(4000)›35 INPUT "Input file: ";IN$›36 INPUT "Output file: ";OUT$›37 CLOSE #1:OPEN #1,4,0,IN$›38 CLOSE #2:OPEN #2,8,0,OUT$›39 REM ›40 REM !------------------------------!›41 REM ! Modify the first segment to !›42 REM ! replace the fixed MEMLO with !›43 REM ! MEMLO-checking code. !›44 REM !------------------------------!›45 GET #1,MLL,MHH:REM file header ›46 GET #1,MLL,MHH:REM Segment head›47 GET #1,MLL,MHH:REM Segment tail›48 GET #1,MLL,MHH:REM Memlo consts›49 PUT #2,$FF,$FF:REM file header›50 PUT #2,$02,$21:REM segment head›51 PUT #2,$1A,$21:REM segment tail›52 PUT #2,$A0,MLL,$A9,MHH›53 PUT #2,$CD,$E8,$02,$90›54 PUT #2,$0F,$D0,$07,$CC›55 PUT #2,$E7,$02,$90,$08›56 PUT #2,$F0,$06,$8D,$E8›57 PUT #2,$02,$8C,$E7,$02,$60›58 PUT #2,$E2,$02:REM init segment›59 PUT #2,$E3,$02:REM init segment›60 PUT #2,$02,$21:REM run new code.›61 REM ›62 REM !------------------------------!›63 REM ! Copy the rest of the file !›64 REM ! in the usual way, making !›65 REM ! a 4000-byte copy pass until !›66 REM ! an EOF or an error occurs. !›67 REM !------------------------------!›68 REPEAT ›69 TRAP #EOF›70 BGET #1,ADR(BUFFER$),4000›71 # EOF:PB=DPEEK($0348+$10)›72 TRAP #ERROR›73 LAST=PB<4000›74 IF PB>0›75 BPUT #2,ADR(BUFFER$),PB›76 ENDIF ›77 UNTIL LAST›78 REM ›79 REM !------------------------------!›80 REM ! Error routine: If EOF then !›81 REM ! the copy completed or the !›82 REM ! user ended his input. !›83 REM ! Otherwise display the error. !›84 REM !------------------------------!›85 # ERROR:CLOSE ›86 IF ERR=136›87 PRINT "Program finished OK."›88 ELSE ›89 PRINT "Error ";ERR;" at line ";ERL›90 ENDIF ›91 END ›