                .DO     External
                .LSTON
                .Page
;>>>>>>>>>>>>>>>>>>>>>>>>
;>
;>      Module: Servo
;>
;>      This module contains all the specifications and source code for 
;>      controlling the Widget Servo Board ( i.e., communication
;>      protocol, seek and head positioning, spare table lookup, etc. )
;>
;>>>>>>>>>>>>>>>>>>>>>>>>
                .LSTOFF
                .FIN
                .DO     External
                .LSTON
                .Page
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>
;>      Function: OverLap       { OverLapped Seek }
;>
;>      This function allows the drive to begin a seek operation
;>      ( if one is needed ) before getting tied up with the SOS
;>      driver.
;>
;>      Inputs:
;>              BlockNumber : 3 BYTES { !rC:E }
;>
;>      Outputs: none
;>
;>      Algorithm:
;>
;>      BEGIN
;>       IF ( Srch_Cache( BlockNumber ) )
;>        THEN
;>         IF ( Srch_Cache.Head <> Head )
;>          THEN SelectHead( Srch_Cache.Head )
;>        ELSE
;>         PositionHeads( NoWait, CnvrtLogical( BlockNumber ) )
;>         Load_Cache
;>         BlkStat := CachStat[ 0 ]
;>         Seek( CnvrtLogical( BlockNumber ) )
;>      END
;>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                .LSTOFF
                .FIN
                .DO     Internal
                .LSTON
                .Page
                .FIN

OverLap:
                Call    Srch_Cache
                Jr      Nz,OvrLapSeek
                
                Push    !r0 ;save Head/Sector info
                Tm      BlkStat,#CachHdChg ;check for a head change
                Jr      Z,Ovr_Ld_Sctr
                
                Xor     Head,#01 ;complement the head value
                 Ld     !rE,Head
                 Ld     !r2,#.HIBYTE. SelectHead
                 Ld     !r3,#.LOWBYTE. SelectHead
                Call    Bank_Call
                
Ovr_LdCache:     Ld     !r2,#.HIBYTE. Load_Cache
                 Ld     !r3,#.LOWBYTE. Load_Cache
                Call    Bank_Call ;update the cache
                 Ld     !r2,#.HIBYTE. Chk_Offset
                 Ld     !r3,#.LOWBYTE. Chk_Offset
                Call    Bank_Call
                
Ovr_Ld_Sctr:    Pop     !r3 ;get Head/Sector infor from stack
                And     !r3,#$1F ;mask off all but sector info
                Ld      Sector,!r3
                Jr      OvrLp_End
                
OvrLapSeek:      Ld     !r2,#.HIBYTE. CnvrtLogical
                 Ld     !r3,#.LOWBYTE. CnvrtLogical
                Call    Bank_Call

OvrLp_Lp:        Clr    !r8 ;no wait
                 Ld     !r2,#.HIBYTE. PosHeads
                 Ld     !r3,#.LOWBYTE. PosHeads
                Call    Bank_Call
                
OvrLp_2:        Call    ExtPush_Vector
                 Ld     !r2,#.HIBYTE. Load_Cache
                 Ld     !r3,#.LOWBYTE. Load_Cache
                Call    Bank_Call ;update the cache
                 
                 Ld     !r2,#.HIBYTE. CachStat
                 Ld     !r3,#.LOWBYTE. CachStat
                 Lde    !r0,@!!r2
                 Ld     BlkStat,!r0
                 
OvrLp_S_1:      Call    ExtPop_Vector
                Call    New_Seek

OvrLp_End:      Jp      Bank_Ret

                .LSTOFF
                
