Commodore 128 Programmer's Reference Manual page 439

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
I !
THE COMMODORE 128 OPERATING SYSTEM
429
RESULTS:
Registers:
.A = error code (if any)
P
.X used
J
.Y used
Memory:
logical tables updated
H
STATUS, RSSTAT updated
i I
Flags:
.C = 1 -> error
j-j
EXAMPLE:
' ;
LDA#1
;la
JSR $FFC3
;CLOSE
H
BCS error
;(tape files only)
/ i
CLOSE removes the logical file (LA) passed in .A from the logical file tables
P
and performs device-specific closing tasks. Keyboard, screen and any unOPENed
I
files pass through. Cassette files opened for output are closed by writing the last
buffer and (optionally) an EOT mark. RS-232 I/O devices are reset, losing any
n
buffered data. Serial files are closed by transmitting a CLOSE command (if an SA
was given when it was opened), sending any buffered character, and UNLSTNing
the bus.
There is a special provision incorporated into the CLOSE routine of systems
j !
featuring a BASIC DOS command. If the following conditions are all true, a full
CLOSE is not performed; the table entry is removed but a CLOSE command is not
transmitted to the device. This allows the disk command channel to be properly
|
OPENed and CLOSEd without the disk operating system closing all files on its
(
end:
n
.c
FA
SA
=
1
> = 8
=
15
-* indicates special CLOSE
-*■ device is a disk
—» command channel
The path to CLOSE is through an indirect RAM vector at $31C. Applications
may therefore provide their own CLOSE procedures or supplement the system's by
redirecting this vector to their own routine.
24. $FFC6 CHKIN ;set input channel
PREPARATION:
Registers:
.X = LA (logical #)
Memory:
system map
Flags:
none
Calls:
OPEN

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents