WriteSparseMemory.mesa
Copyright © 1984, 1985, 1986 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) September 10, 1986 11:15:17 pm PDT
DIRECTORY
DragOpsCross USING [Word, ZerosWord],
IO USING [STREAM],
Rope USING [ROPE],
SparseMemory USING [Base];
WriteSparseMemory:
CEDAR
DEFINITIONS =
BEGIN
OPEN DragOpsCross, IO, SparseMemory, Rope;
TestAbort:
TYPE =
PROC
RETURNS [abort:
BOOL ←
FALSE];
ToStream:
PROC [st:
STREAM, base: Base, start: Word ← ZerosWord, words:
INT ←
LAST[
INT], byteOutput, displayCode:
BOOL ←
FALSE, testAbort: TestAbort ←
NIL];
Writes stream in Dragon memory file format starting at the given address.
If byteOutput, then use byte output format.
If displayCode, then display instructions (when legal).
If testAbort # NIL, then it is periodically called to test for abort requests.
ToFile:
PROC [name:
ROPE, base: Base, byteOutput, displayCode:
BOOL ←
FALSE];
First writes header giving file name, author, and date, then writes file in Dragon memory file format using ToStream. Finally closes the file. Allows FS.Error to propagate through.
If byteOutput, then use byte output format.
If displayCode, then display instructions (when legal).
END.