Hardware manual

@(OsBuffer>>OsBUF.In) = i
OsBuffer>>OsBUF.In = newIn
resultis -1
]
GetItemCount() = valof //Returns count of items in buffer
[
let c = OsBuffer>>OsBUF.In-OsBuffer>>OsBUF.Out
if c ls 0 then c = c+OsBuffer>>OsBUF.Last-OsBuffer>>OsBUF.First
resultis c
]
ResetItemBuffer() be //Set buffer to empty
[
OsBuffer>>OsBUF.In = OsBuffer>>OsBUF.First
OsBuffer>>OsBUF.Out = OsBuffer>>OsBUF.First
]
#176777 This location, the last in memory, points to the beginning of the
area used to save statics for levBasic through levBcpl. The file
Sys.Bk documents offsets from this number where the various
statics will be found.
4.7. Swat
The operating system contains an interface to the Swat debugger (described in the "Alto Subsystems"
manual). This interface uses OutLd to save the state of the machine on the file "Swatee," and InLd to
restore the state of the machine from the file "Swat," which contains the saved state of the debugger itself.
The inverse process is used to proceed from an interrupt or breakpoint. Two aspects of the Swat interface
are of interest to programmers:
lvAbortFlag If @lvAbortFlag is zero, holding down the <left-shift> and <B3>
keys will simulate the call OsFinish(fcAbort), thus terminating
execution of the running program. In critical sections, setting
@lvAbortFlag to a non-zero value will disable aborts. The
standard convention is to increment @lvAbortFlag when
entering such a section and to decrement it when exiting. This
permits separate software modules to use the feature
concurrently.
lvSwatContextProc Although Swat saves and restores the state of the standard Alto
I/O devices, it has no way to know about special devices
attached to the machine. The programmer may arrange that a
peice of code will be called whenever Swat is trying to turn off
I/O preparatory to calling OutLd, or trying to restart I/O after
an InLd. If the programmer does
@lvSwatContextProc=DLSProc, Swat will execute DLSProc(0)
when turning off I/O, and DLSProc(-1) when turning it on.
Since Swat can be invoked at any time, the Swat context
procedure must be written in machine language and must not
assume anything about the state of the machine or any data
structures (in particular the Bcpl stack may be in an inconsistant
state).
Alto Operating System May 5, 1980 25
For Xerox Internal Use Only -- December 15, 1980