.LOD JSR rfile \ Call rfile to load the commander file to the TAP% \ staging area LDA TAP% \ If the first byte of the loaded file has bit 7 set, BMI ELT2F \ jump to ELT2F, as this is an invalid commander file \ \ ELT2F contains a BRK instruction, which will force an \ interrupt to call the address in BRKV, which will \ print out the system error at ELT2F LDY #NT% \ We have successfully loaded the commander file to the \ TAP% staging area, so now we want to copy it to the \ last saved commander data block at NA%+8, so we set up \ a counter in Y to copy NT% bytes .copyme LDA TAP%,Y \ Copy the Y-th byte of TAP% to the Y-th byte of NA%+8 STA NA%+8,Y DEY \ Decrement the loop counter BPL copyme \ Loop back until we have copied all NT% bytes .LOR SEC \ Set the C flag RTS \ Return from the subroutine .ELT2F LDA #9 \ Print extended token 9 ("{cr}{all caps}ILLEGAL ELITE JSR DETOK \ II FILE{sentence case}") JSR t \ Scan the keyboard until a key is pressed, returning \ the ASCII code in A and X JMP SVE \ Jump to SVE to display the disc access menu and return \ from the subroutine using a tail callName: LOD [Show more] Type: Subroutine Category: Save and load Summary: Load a commander fileContext: 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: * SVE calls LOD * GTDRV calls via LOR
The filename should be stored at INWK, terminated with a carriage return (13).
Other entry points: LOR Set the C flag and return from the subroutine
[X]
Subroutine DETOK (category: Text)
Print an extended recursive token from the TKN1 token table
[X]
Label ELT2F is local to this routine
[X]
Variable NA% (category: Save and load)
The data block for the last saved commander
[X]
Subroutine SVE (category: Save and load)
Display the disk access menu and process saving of commander files
[X]
Configuration variable TAP% = LS% - 111
The staging area where we copy files after loading and before saving (though this isn't actually used in this version, and is left-over Commodore 64 code)
[X]
Label copyme is local to this routine
[X]
Subroutine rfile (category: Save and load)
Load the commander file