!pr2
!lm12
!rm75
Free Space Patch For the S-C Assembler...........Mike Sanders

Volume 5, Number 6 of Call A.P.P.L.E. has an article giving a DOS patch to replace the volume number printed during catalog with number of free sectors remaining on the disk.

The routine as published works for both Applesoft and Integer BASIC, but does not work with the language card version of the S-C Assembler.  Only a few changes were needed to make it work with all three.

A call to Bob gave me the location of the decimal print routine in the S-C Macro Assembler, Language Card Version.

The original code as published in CAll A.P.P.L.E. checked location $E006 to see what language is in use.  My code looks at $E001, which has a different value in each of the three:

!lm+5
          Language   $E001
--------------------------
          Applesoft:  $28
      Integer BASIC:  $00
S-C Macro Assembler:  $94
!lm-5

The code in lines 1320-1370 checks which language is in use and jumps to the right routine.  I also changed the zero page locations used to count the number of free sectors because the S-C Assembler print routine expects the two-byte value to be in $D3 and $D4.

The rest of the code works as explained in the Call A.P.P.L.E. article.  I refer you to it for more details and as an excellent lesson on reducing the size of code.

Install the two patches to DOS by BLOADing the two binary files FREE.SECTORS.1 and FREE.SECTORS.2.   The type CATALOG to see the how many free sectors you have.
