Commodore 128 Programmer's Reference Manual page 438

Hide thumbs Also See for 128:
Table of Contents

Advertisement

428
COMMODORE 128
RESULTS:
Registers:
Memory:
Flags:
EXAMPLE:
LDA #length
LDX #<filename
LDY #>filename
JSR
$FFBD
LDX #0
JSR
$FF68
LDA #1
LDX #8
LDY #15
JSR
$FFBA
JSR
$FFC0
BCS error
filename .BYTE '10'
length
= 2
.A = error code (if any)
.X used
.Y used
setup for I/O
STATUS, RSSTAT updated
.C = 1 -» error
OPEN 1,8,15,"IO"
;fnlen
;fnadr (command)
;SETNAM
;fnbank (RamO)
;SETBNK
;la
;fa
;sa
;SETLFS
;OPEN
u
u
u
OPEN prepares a logical file for I/O operations. It creates a unique entry in
the Kernal logical file tables LAT ($362), FAT ($36C) and SAT ($376) using its
index LDTND ($98) and data supplied by the user via SETLFS. There can be up to
ten logical files OPENed simultaneously. OPEN performs device-specific opening
tasks for serial, cassette and RS-232 devices, including clearing the previous status and
transmitting any given filename or command string supplied by the user via SETNAM
and SETBNK. The I/O status is updated appropriately and can be read via READSS.
The path to OPEN is through an indirect RAM vector at $31 A. Applications
may therefore provide their own OPEN procedures or supplement the system's by
redirecting this vector to their own routine.
23. $FFC3 CLOSE ;close logical file
PREPARATION:
Registers:
Memory:
Flags:
Calls:
.A = LA (logical #)
system map
.C (see text below)
none
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents