GenLSUnderflowKernel:
PROC
RETURNS [
lsUnderflowKernel: Label ] = {
sLimitValue: [0..128) = 16;
UnderflowHandler must have been set.
underflowTrap: Label;
lsUnderflowKernel ← GenLabelHere[];
-- one frame on IFU stack
drLIB[sLimitValue];
drSIP[DragOpsCross.ProcessorRegister[ifuSLimit].ORD];
GetEldestPC[]; -- pops IFU stack to EU stack top
drSFC[]; -- Call caller's return PC (underflowTrap pushed onto IFU stack)
underflowTrap ← GenLabelHere[];
-- no frames on stack
drROR[c: pushDst, a: const0, b: underflowHandler];
drSFC[];
drJB[UseLabel8A[underflowTrap]]};
FillTrap:
PROC [ trap: DragOpsCross.TrapIndex, label: Label ] = {
oldPC: LONG CARDINAL = GetOutputPC[];
SetOutputPC[DragOpsCrossUtils.TrapIndexToBytePC[trap]];
drJDB[UseLabel16[label]]; -- go to trap handler
SetOutputPC[oldPC]};
M A I N L I N E C O D E
LSUnderflowKernel: Label = GenLSUnderflowKernel[];
Start: Label = GenLabel[];
FillTrap[ResetTrap, Start ];
Start
SetLabel[ Start ]; -- gets here from reset in kernel mode with traps off
Set up EU SLimit and install IFU stack underflow service routine (kernel mode, traps off)
drLFC[UseLabel16[ LSUnderflowKernel ]];
Exercise KBus
drLIQB[ CardToWord[000000000H]];
SetEldestPC[];
GetEldestPC[];
drLIQB[ CardToWord[055555555H]];
SetEldestPC[];
GetEldestPC[];
drLIQB[ CardToWord[0FFFFFFFFH]];
SetEldestPC[];
GetEldestPC[];
drLIQB[ CardToWord[0AAAAAAAAH]];
SetEldestPC[];
GetEldestPC[];
drLIQB[ CardToWord[000000000H]];