// Copyright Xerox Corporation 1979
external [ Ws; InitializeInterrupt; FindInterruptMask; CauseInterrupt ]
static [ lowChannel; tickCount ]
manifest verticalInterval=#421

let main() be
	[
	let stack1=vec 40
	let stack2=vec 200

// Initialize two interrupt channels
	let high=InitializeInterrupt(stack1, 40,
			FindInterruptMask(1), HighProc)
	lowChannel=InitializeInterrupt(stack2, 200,
			FindInterruptMask(high), LowProc)
	tickCount=0
// Arrange vertical interval to cause interrupts on channel "high"
	@verticalInterval=@verticalInterval % high
	while true do loop
	]

and HighProc() be
	[
	if tickCount eq 0 then
		[
		tickCount=-60
		CauseInterrupt(lowChannel)
		]
	tickCount=tickCount+1
	]

and LowProc() be
	[
	Ws("Tick ")
	]