home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore 64 Scene Diskmags Assortment
/
Vision_02_19xx_Vision_Side_C.d64
/
ldfile.s
< prev
next >
Wrap
Text File
|
2023-02-26
|
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