4 ; Simplified saving with coroutines
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's Sapphire library.
13 ; Sapphire is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
18 ; Sapphire is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sapphire. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ;----- Overview -------------------------------------------------------------
40 [ :LNOT::DEF:xsave__dfn
45 ; On entry: R0 == pointer to saver routine
46 ; R1 == R10 value to pass to saver
47 ; R2 == R12 value to pass to saver
48 ; R3 == pointer to filename to save to
49 ; R4 == filetype of file to save
51 ; On exit: May return an error
53 ; Use: Calls a generalised saver routine to write data to a file.
59 ; On entry: R0 == pointer to saver routine
60 ; R1 == R10 value to pass to saver
61 ; R2 == R12 value to pass to saver
63 ; On exit: R0 == pointer to block to send
65 ; CS if this is the last block, else CC
68 ; Use: Calls a generalised saver routine to write data to another
69 ; application, using RAM transfer. Note that you must call
70 ; this routine from your send entry point throughout the
81 ; Use: Tidies up after a successful save job.
85 ; --- xsave_failed ---
87 ; On entry: R0 == pointer to error block
91 ; Use: Tidies up a RAM transfer after an error.
97 ; On entry: R0 == byte to write in lowest 8 bits
99 ; On exit: May return an error
101 ; Use: Writes a single byte to the current output.
107 ; On entry: R0 == word to write
109 ; On exit: May return an error
111 ; Use: Writes a single word to the current output.
115 ; --- xsave_string ---
117 ; On entry: R0 == pointer to a control-terminated string
119 ; On exit: May return an error
121 ; Use: Writes a control-terminated string to the current output.
122 ; The string is null terminated in the output file.
126 ; --- xsave_block ---
128 ; On entry: R0 == pointer to buffer to write
129 ; R1 == size of buffer to write
131 ; On exit: May return an error
133 ; Use: Writes out a block of data. Data is buffered, so this is
134 ; fairly quick for reading small objects. Large data blocks
135 ; are sent directly to avoid buffering overhead.
141 ;----- That's all, folks ----------------------------------------------------