;SFS Library system using MSSCAN/LIBLOAD/RUN&DEL VARIABLE RCTL ; LIBEND - used to terminate library chunks. Does CONSOLE ; then if RCTL <> 0 runs and deletes word on Y stack OCTAL DEFINE LIBExx ;ENSEC=047552 CONSxxx RCTL GET IFNZ RCTL #0 PUT Y>>X RUN&xxx ENDIx END ; LIB - opens library, hardcoded as "LIBRARY" in volume "LIB" ; on drive 0. Volume "LIB" must already exist, an empty library ; is created with a single 128 byte if "LIBRARY" doesn't exist. ; All library operations use SFS buffer 3. OCTAL DEFINE LIB ;ENSEC=047415 "LIB" 000003 #0 DIRExxxxx FSS GET IFZ "LIBRARY" 000003 OPEN FSS GET IFNZ " creating" $PRIxx "LIBRARY" 000003 CNF "LIBRARY" 000003 OPEN MS_Sxxx 000003 >FILx 000200 MSBOxx MS_Rxxxxxx 000003 CLOSx "LIBRARY" 000003 OPEN ENDIx ENDIx END ; "name" D2L - writes definition to library, must be open ; note - after writing definitions do 3 CLOSE to save it! OCTAL DEFINE D2L ;ENSEC=047571 $DUP $DEFxxx IFZ $PRIxx " not found" $PRIxx ELSE CWA 000003 ADD GET #1 AND IFZ $DROx "No library" $PRIxx ELSE MS_Sxxx 000003 >FILx >MS 000003 FSA 000003 ADD GET DEC SEEK ";;;FILE:" $PRIxx $DUP $PRIxx ":" $PRIxx CRLF $DEFxxx PDEF "LIBEND" $PRIxx CRLF 000200 MSBOxx <>COx MS_Rxxxxxx ENDIx ENDIx END ; "name" R - runs word from open library then forgets it ; name is stored on Y stack for LIBEND to run/forget OCTAL DEFINE R ;ENSEC=047717 CWA 000003 ADD GET #1 AND IFZ "No library" $PRIxx $DROx ELSE 000003 >Y LIBLxxx ENDIx END ; "name" L - loads word from open library OCTAL DEFINE L ;ENSEC=047765 CWA 000003 ADD GET #1 AND IFZ "No library" $PRIxx $DROx ELSE 000003