	  MNAME OSD_LLA
	  SRC MODULE OSD_LLA;
	  SRC IMPORT SCSI_DEFS, iodeclarations;
	  SRC EXPORT
	  SRC   TYPE
	  SRC     TIMER_REC = RECORD
	  SRC                   TIME : INTEGER;
	  SRC                   FLAG : s_short; { MSR }
	  SRC                 END;
	  SRC
	  SRC     PROCEDURE START_TIMER(VAR TIME : TIMER_REC);
	  SRC     FUNCTION  TIME_EXPIRED(VAR TIME : TIMER_REC):BOOLEAN;
	  SRC
	  SRC END; { OSD_LLA }

	  DEF OSD_LLA_OSD_LLA
	  DEF OSD_LLA_START_TIMER
	  DEF OSD_LLA_TIME_EXPIRED

timer_present   equ     1
sysflag2        equ     $FFFFFEDA
		REFA    CHECK_TIMER   in system POWERUP code
		LMODE   CHECK_TIMER
*************************************************************************
* START_TIMER                           timing setup
*
*   ASSUMES:
*       - sp+4 points to location of a timer record
*              the TIME field is a delay in milliseconds
*   RETURNS:
*       - The TIME field contains a value to match against the timer
*         (no timer present then this field is a scaled count)
*************************************************************************
OSD_LLA_START_TIMER equ *
	movea.l 4(sp),a0        get addr of timer rec
	btst    #timer_present,sysflag2
	bne.s   soft_start
	st      4(a0)   set the first time flag
	jmp     CHECK_TIMER

soft_start equ  *
*       scale the time out value for use as a counter
	move.l  (a0),d0
	lsl.l   #4,d0           x 16
	move.l  d0,(a0)
	move.l  (sp)+,(sp)      move the return address
	rts
*************************************************************************
* FUNCTION TIME_EXPIRED(VAR TIME: INTEGER):BOOLEAN;
*   ASSUMES:
*       - sp+4 points to a timer record (set up by start_timer)
*************************************************************************

OSD_LLA_TIME_EXPIRED  EQU *
	clr.b   8(sp)           clear the function value
	btst    #timer_present,sysflag2
	bne.s   soft_check
	move.l  4(sp),-(sp)     copy the timer rec address
	jsr     CHECK_TIMER
	bpl.s   timex1
timex0  move.b  #1,8(sp)
timex1  move.l  (sp)+,(sp)      move the return address
	rts
soft_check equ  *
	movea.l 4(sp),a0
	subq.l  #1,(a0)
	bpl     timex1
	bra     timex0
*
*       module initialization
*
OSD_LLA_OSD_LLA EQU *
	  RTS

	end
