# File: frmchk_v07.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/prep/src/frmchk_v07.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#;==================================================
#;
#; FRAMECHK
#;
#; Check if actual frame number = expected frame number
#;
#; Register Usage:                                            | In
#;   R3072           - Actual Frame number                    |   
#;   IPRL_STR_EXPFRM - Expected frame number                  |   
#;   IPRL_STR_FRMDIF = (Actual) XOR (Expected)                |   
#;   IPRL_STR_FRMERR - Number of frame errors in obs interval |   
#;   IPRL_STR_FRERRH - Pointer to error exit                  |  &
#;
#;
#; V0.06 24 Jul 96 Dnyanesh Mathur
#;   1. The copy of DEP reg R0 (IP reg 3072) is used to reset
#;      the "expected" frame number.
#;................................................................
#;
#QSR_STR_FRMCHK::
#    REGXOR    R3072   $IPRL_STR_EXPFRM   $IPRL_STR_FRMDIF
tcblock mbipmacl 0x0D00    0x4150 0x0C00 0x0678 0x0679 
#;
#;>>>>> Set up parameters for next frame before checking for error
#;
#    COPYRD2I  R0105     R115     10                ; Save CCD hdr
tcblock mbipmacl 0x0D04    0x01AA 0x0069 0x0073 0x000A 
#    ADDREGD   R0115              10
tcblock mbipmacl 0x0D08    0x01BC 0x0073 0x000A 
#    ADDREGD   $IPRL_STR_EXPFRM   1                 ; Incr expecte
tcblock mbipmacl 0x0D0B    0x01BC 0x0678 0x0001 
#    ADDREGD   $IPRL_STR_FRERRH   3                 ; Point to nex
tcblock mbipmacl 0x0D0E    0x01BC 0x067B 0x0003 
#;
#    BRANCHNE  R3072              1   &CHKMODE      ; Reset on rea
tcblock mbipmacl 0x0D11    0x01B0 0x0C00 0x0001 0x0D1B 
#    SETREG    $IPRL_STR_EXPFRM   2
tcblock mbipmacl 0x0D15    0x0140 0x0678 0x0002 
#    SETREG    $IPRL_STR_FRERRH   &FRERRH01
tcblock mbipmacl 0x0D18    0x0140 0x067B 0x0D56 
#;
#CHKMODE:
#    BRANCHEQ  $IPRL_STR_ACCTIM  30   &P30FRM       ; Prime60 or P
tcblock mbipmacl 0x0D1B    0x01AE 0x003C 0x001E 0x0D25 
#;
#P60FRM:
#    BRANCHLT  $IPRL_STR_EXPFRM  21   &CHKFRMERR    ; P60; Max Frm
tcblock mbipmacl 0x0D1F    0x01B8 0x0678 0x0015 0x0D3A 
#    GOTO      &SET_FRMCHK
tcblock mbipmacl 0x0D23    0x0156 0x0D29 
#;
#P30FRM:
#    BRANCHLT  $IPRL_STR_EXPFRM  11   &CHKFRMERR    ; P30; Max Frm
tcblock mbipmacl 0x0D25    0x01B8 0x0678 0x000B 0x0D3A 
#;
#SET_FRMCHK:
#    SAVERLST  R3895     200      6:0x11FF38
tcblock mbipmacl 0x0D29    0x014A 0x0F37 0x00C8 0xFF38 \
                                0x3011 
#    SETREG    $IPRL_STR_EXPFRM   1                 ; Reset Exp fr
tcblock mbipmacl 0x0D2E    0x0140 0x0678 0x0001 
#    SETREG    $IPRL_STR_FRERRH   &FRERRH01         ; Reset err ex
tcblock mbipmacl 0x0D31    0x0140 0x067B 0x0D56 
#    SETREG    $IPRL_STR_FRMERR   0                 ; Reset bad fr
tcblock mbipmacl 0x0D34    0x0140 0x067A 0x0000 
#    SETREG    R0115              R3895
tcblock mbipmacl 0x0D37    0x0140 0x0073 0x0F37 
#;
#CHKFRMERR:
#    BRANCHNE  $IPRL_STR_FRMDIF   0  &ERREXIT
tcblock mbipmacl 0x0D3A    0x01B0 0x0679 0x0000 0x0D42 
#    SETREG    $IPRL_STR_FRMBAD   0                 ; Frame is goo
tcblock mbipmacl 0x0D3E    0x0140 0x06A7 0x0000 
#    RTNQUE
tcblock mbipmacl 0x0D41    0x01FA 
#;
#;................................................................
#;
#ERREXIT:
#    SETREG    $IPRL_STR_FRMBAD   1                 ; Set bad fram
tcblock mbipmacl 0x0D42    0x0140 0x06A7 0x0001 
#    COPYREG   R3072              R125
tcblock mbipmacl 0x0D45    0x0142 0x0C00 0x007D 
#    COPYREG   $IPRL_STR_EXPFRM   R126
tcblock mbipmacl 0x0D48    0x0142 0x0678 0x007E 
#    COPYREG   $IPRL_STR_FRMDIF   R127
tcblock mbipmacl 0x0D4B    0x0142 0x0679 0x007F 
#    ADDREGD   $IPRL_STR_FRMERR   1                 ; Incr bad fra
tcblock mbipmacl 0x0D4E    0x01BC 0x067A 0x0001 
#    GOTOREG   $IPRL_STR_FRERRH                     ; exit based o
tcblock mbipmacl 0x0D51    0x0158 0x067B 
#;
#FRERRH:
#    THROW     0xFE00
tcblock mbipmacl 0x0D53    0x01EA 0xFE00 
#    RTNQUE
tcblock mbipmacl 0x0D55    0x01FA 
#FRERRH01:
#    THROW     0xFE01
tcblock mbipmacl 0x0D56    0x01EA 0xFE01 
#    RTNQUE
tcblock mbipmacl 0x0D58    0x01FA 
#    THROW     0xFE02
tcblock mbipmacl 0x0D59    0x01EA 0xFE02 
#    RTNQUE
tcblock mbipmacl 0x0D5B    0x01FA 
#    THROW     0xFE03
tcblock mbipmacl 0x0D5C    0x01EA 0xFE03 
#    RTNQUE
tcblock mbipmacl 0x0D5E    0x01FA 
#    THROW     0xFE04
tcblock mbipmacl 0x0D5F    0x01EA 0xFE04 
#    RTNQUE
tcblock mbipmacl 0x0D61    0x01FA 
#    THROW     0xFE05
tcblock mbipmacl 0x0D62    0x01EA 0xFE05 
#    RTNQUE
tcblock mbipmacl 0x0D64    0x01FA 
#    THROW     0xFE06
tcblock mbipmacl 0x0D65    0x01EA 0xFE06 
#    RTNQUE
tcblock mbipmacl 0x0D67    0x01FA 
#    THROW     0xFE07
tcblock mbipmacl 0x0D68    0x01EA 0xFE07 
#    RTNQUE
tcblock mbipmacl 0x0D6A    0x01FA 
#    THROW     0xFE08
tcblock mbipmacl 0x0D6B    0x01EA 0xFE08 
#    RTNQUE
tcblock mbipmacl 0x0D6D    0x01FA 
#    THROW     0xFE09
tcblock mbipmacl 0x0D6E    0x01EA 0xFE09 
#    RTNQUE
tcblock mbipmacl 0x0D70    0x01FA 
#    THROW     0xFE0A
tcblock mbipmacl 0x0D71    0x01EA 0xFE0A 
#    RTNQUE
tcblock mbipmacl 0x0D73    0x01FA 
#    THROW     0xFE0B
tcblock mbipmacl 0x0D74    0x01EA 0xFE0B 
#    RTNQUE
tcblock mbipmacl 0x0D76    0x01FA 
#    THROW     0xFE0C
tcblock mbipmacl 0x0D77    0x01EA 0xFE0C 
#    RTNQUE
tcblock mbipmacl 0x0D79    0x01FA 
#    THROW     0xFE0D
tcblock mbipmacl 0x0D7A    0x01EA 0xFE0D 
#    RTNQUE
tcblock mbipmacl 0x0D7C    0x01FA 
#    THROW     0xFE0E
tcblock mbipmacl 0x0D7D    0x01EA 0xFE0E 
#    RTNQUE
tcblock mbipmacl 0x0D7F    0x01FA 
#    THROW     0xFE0F
tcblock mbipmacl 0x0D80    0x01EA 0xFE0F 
#    RTNQUE
tcblock mbipmacl 0x0D82    0x01FA 
#    THROW     0xFE10
tcblock mbipmacl 0x0D83    0x01EA 0xFE10 
#    RTNQUE
tcblock mbipmacl 0x0D85    0x01FA 
#    THROW     0xFE11
tcblock mbipmacl 0x0D86    0x01EA 0xFE11 
#    RTNQUE
tcblock mbipmacl 0x0D88    0x01FA 
#    THROW     0xFE12
tcblock mbipmacl 0x0D89    0x01EA 0xFE12 
#    RTNQUE
tcblock mbipmacl 0x0D8B    0x01FA 
#    THROW     0xFE13
tcblock mbipmacl 0x0D8C    0x01EA 0xFE13 
#    RTNQUE
tcblock mbipmacl 0x0D8E    0x01FA 
#    THROW     0xFE14
tcblock mbipmacl 0x0D8F    0x01EA 0xFE14 
#    RTNQUE
tcblock mbipmacl 0x0D91    0x01FA 
#;================================================================
#=======================================================
#
return
#
#=======================================================
