
 1000  *SAVE S.FREE SECTORS
 1010  *--------------------------------
 1020  *      FREE SECTORS PATCH FOR DOS 3.3
 1030  *--------------------------------
 1040  LOBYTE .EQ $D3
 1050  HIBYTE .EQ $D4
 1060  *--------------------------------
 1070  SECTOR.MAP .EQ $B3F2
 1080  LANG.ID    .EQ $E001    LANGUAGE ID
 1090  PRT.INT    .EQ $E51B    INTEGER BASIC PRINT ROUTINE
 1100  PRT.FP     .EQ $ED24    APPLESOFT PRINT ROUTINE
 1110  PRT.SC     .EQ $DE00    S-C ASSEMBLER PRINT ROUTINE
 1120  *--------------------------------
 1130         .OR $BA69
 1140         .TF FREE.SECTORS.1
 1150  *--------------------------------
 1160  FREE.SECTOR.PATCH
 1170         LDY #$C8
 1180  .1     LDA SECTOR.MAP,Y
 1190         BEQ .4            NO FREE SECTORS IN THIS BYTE
 1200  .2     ASL               SHIFT INTO CARRY
 1210         BCC .2            SECTOR IN USE
 1220         PHA               SECTOR FREE
 1230         INC LOBYTE        COUNT IT
 1240         BNE .3
 1250         INC HIBYTE
 1260  .3     PLA               SECTOR MAP BYTE AGAIN
 1270         BNE .2            IF ANY LEFT
 1280  .4     DEY               NEXT BYTE OF SECTOR MAP
 1290         BNE .1
 1300         LDX LOBYTE        VALUE IN X AND A
 1310         LDA HIBYTE
 1320         LDY LANG.ID       CHECK WHICH LANGUAGE
 1330         BMI SCASM         $94: S-C ASSEMBLER
 1340         BEQ INTEGR        $00: INTEGER BASIC
 1350         JMP PRT.FP        $28: APPLESOFT
 1360  INTEGR JMP PRT.INT
 1370  SCASM  JMP PRT.SC
 1380  *--------------------------------
 1390         .OR $ADB9
 1400         .TF FREE.SECTORS.2
 1410  *--------------------------------
 1420         NOP               FILLER
 1430         LDA #0            ZERO THE COUNT
 1440         STA LOBYTE
 1450         STA HIBYTE
 1460         JSR FREE.SECTOR.PATCH
 1470  *--------------------------------

