home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Demos
/
VISION2C.SFX
/
ldfile.s
< prev
next >
Wrap
Text File
|
1994-11-18
|
915b
|
44 lines
;MOZART TUE14DEC93 ML FILE LOAD
;
;FILE OPEN, FILE CLOSE AND ERROR
;CHECKING DONE BY BASIC
;
;DEFINE ASSEMBLER CONSTANTS
;
CHKIN = $FFC6 ;DESIGNATE INPUT FILE
CHRIN = $FFCF ;READ A BYTE
CLRCHN = $FFCC ;CLEAR ALL CHANNELS
GENPTR = $FD ;ZERO PAGE POINTER
SOV = $2D ;BASIC START OF VARS
STATUS = $90 ;BASIC STATUS BYTE
TEMP = $57 ;TEMPORARY BYTE DUMP
;
*=$0ACA ;SYS 2762
;
JSR CLRCHN ;CLEAR ALL I/O CHANNELS
LDY #3 ;GET BASIC IL% VALUE
LDA (SOV),Y ;IS LOGICAL FILE
TAX
JSR CHKIN ;DESIGNATE AS INPUT FILE
;
JSR CHRIN ;GET LO BYTE HEADER
STA GENPTR
JSR CHRIN ;GET HI BYTE HEADER
STA GENPTR+1
;
RDLOOP JSR CHRIN ;GET DATA BYTE
LDX STATUS ;GET I/O STATUS BYTE
STX TEMP ;SAVE FOR LATER
;
LDY #0
STA (GENPTR),Y ;STORE DATA BYTE
INC GENPTR ;INCREMENT POINTER
BNE SKIP
INC GENPTR+1
SKIP LDA TEMP ;TEST STATUS NOW
BEQ RDLOOP ;ZERO MEANS GET MORE
;
JSR CLRCHN ;CLEAR I/O CHANNELS
RTS
.END