This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
Name: QUS1 Type: Subroutine Category: Save and load Summary: Save or load the commander file Deep dive: Commander save files
The filename should be stored at INWK, terminated with a carriage return (13).
Arguments: A File operation to be performed. Can be one of the following: * 0 (save file) * &FF (load file)
.QUS1
The enhanced versions support the entering of disc drive numbers when loading or saving.
This variation is blank in the Cassette and Electron versions.
PHA \ Store A on the stack so we can restore it after the \ call to GTDRV JSR GTDRV \ Get an ASCII disc drive number from the keyboard in A, \ setting the C flag if an invalid drive number was \ entered STA INWK+1 \ Store the ASCII drive number in INWK+1, which is the \ drive character of the filename string ":0.E." PLA \ Restore A from the stack BCS QUR \ If the C flag is set, then an invalid drive number was \ entered, so jump to QUR to return from the subroutine
PHA \ Store A on the stack so we can restore it after the \ call to DODOSVN LDA #255 \ Set the SVN flag to 255 to indicate that disc access JSR DODOSVN \ is in progress PLA \ Restore A from the stack
JSR CLDELAY \ Pause for 1280 empty loops LDA #0 \ Set the SVN flag to 0 indicate that disc access has JSR DODOSVN \ finished