//CBM-Specific demo of FileLib.c65 //Remove this one and a file containing the momory from $A000-$BFFF will be written //on you diskdrive GOTO skiptext LABEL filename ASM db "TESTFILE,P,R" db 0 db "@:TESTFILE,P,W" db 0 ENDASM LET lib_fopen_filenr GET 2 LET lib_fopen_devicenr GET 8 LET lib_fopen_secondnr GET 2 POINTER lib_fopen_filenameptr TO filename GOSUB lib_fopen LET lib_fwriteblock_filenr GET 2 LET lib_fwriteblock_blockptr GET $a000 LET lib_fwriteblock_size GET $2000 GOSUB lib_fwriteblock LET lib_fclose_filenr GET 2 GOSUB lib_fclose //This code reads up TESTFILE from device#8 and //Stores the contents at $5000 LABEL skiptext LET lib_fopen_filenr GET 2 LET lib_fopen_devicenr GET 8 LET lib_fopen_secondnr GET 2 POINTER lib_fopen_filenameptr TO filename GOSUB lib_fopen LET lib_freadblock_filenr GET 2 LET lib_freadblock_blockptr GET $5000 LET lib_freadblock_size GET $2000 GOSUB lib_freadblock IF lib_freadblock_size <> $2000 THEN POKE $0400 WITH 0 ENDIF LET lib_fclose_filenr GET 2 GOSUB lib_fclose SUBEND