.QUS1 LDX #INWK \ Store a pointer to INWK at the start of the block at STX &0A00 \ &0A00, storing #INWK in the low byte because INWK is \ in zero page LDX #&FF \ Set KEYB to &FF to indicate that we should process all STX KEYB \ interrupts, so the call to OSFILE will work correctly INX \ Set X = 0 JSR OSFILE \ Call OSFILE to do the file operation specified in \ &0A00 (i.e. save or load a file depending on the value \ of A) INC KEYB \ Increment KEYB back to 0 to indicate that we can \ ignore interrupts once again RTS \ Return from the subroutineName: QUS1 [Show more] Type: Subroutine Category: Save and load Summary: Save or load the commander file Deep dive: Commander save filesContext: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * LOD calls QUS1 * SVE calls QUS1
The filename should be stored at INWK, terminated with a carriage return (13). The routine should be called with Y set to &C.
Arguments: A File operation to be performed. Can be one of the following: * 0 (save file) * &FF (load file) Y Points to the page number containing the OSFILE block, which must be &C because that's where the pointer to the filename in INWK is stored below (by the STX &0C00 instruction)
[X]
Variable KEYB in workspace S% (Part 1 of 2)
This flag indicates whether we are currently processing an OS command (OSWORD, OSRDCH or OSFILE), in which case interrupts will be enabled in the IRQ1 interrupt handler, and keyboard interrupts will be passed to the operating system's keyboard handler in the KEY1 interrupt handler
[X]
Configuration variable OSFILE = &FFDD
The address for the OSFILE routine