// SpruceMeasure.bcpl   

// See also
//	SpruceMeasureMl.
// Either these two files or
//	SpruceMeasureDummyMl
//  are loaded with Sprint. They implement the routines needed to record information about engine
//  control and imaging behavior for later analysis. Other routines involved are:
//	SharedStatics -- define use of #20000 bit
//	SpruceShow -- allocate room for measureTable, conditioned by #20000 bit
//	SprucePrint -- invoke appropriate calls to initialize, close, invoke measurement
//	SpruceEarMl -- Ticker code invokes TickMeasure if measuring

// outgoing procedures

external // Internal
	[
	Measure
	CloseMeasure
	]

external // external
	[
	CallSwat
	DebugSystem
	DisableInterrupts
	EnableInterrupts
	measuring
	measureTable
	TickMeasure
	]

let Measure(index, value) be if (DebugSystem&#20000) ne 0 then 
   [ let adr = #100+index; DisableInterrupts(); @adr = value; TickMeasure(); EnableInterrupts() ]

and CloseMeasure() be if (DebugSystem&#20000) ne 0 then
    [ measuring = false; @#721 = measureTable; CallSwat("Swatee ready for analysis") ]


// March 12, 1979  9:59 PM, created by Swinehart
//