# File: ipcntrl.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; IPCNTRL (babysteps)
#;
#; This program checks the frame number and calls the 
#; appropriate processing routine.
#;
#;------------------------------------------------------------
#;
#QPROG_IPCNTRL::
#TST00:    BRANCHEQ  R3072  1  &TST10
tcblock mbipcmd 0x0091 0x1C00   0x01AE 0x0C00 0x0001 0x1C10 
#          BRANCHEQ  R3072  9  &TST10
tcblock mbipcmd 0x0091 0x1C04   0x01AE 0x0C00 0x0009 0x1C10 
#          BRANCHEQ  R3072  10 &TST10
tcblock mbipcmd 0x0091 0x1C08   0x01AE 0x0C00 0x000A 0x1C10 
#          BRANCHNE  R3072  20 &TST20
tcblock mbipcmd 0x0091 0x1C0C   0x01B0 0x0C00 0x0014 0x1C24 
#;
#; copies header from page 3 as DPC FFFFFF10 for frames 1,9,10,20
#;
#TST10:    SETREGS   R2992  6  1  0x1800  0x4000       0  0xFFFF  
tcblock mbipcmd 0x0091 0x1C10   0x01B2 0x0BB0 0x0006 0x0001 \
                                0x1800 0x4000 0x0000 0xFFFF \
                                0xFF10 
#          HRDINIT   R2992
tcblock mbipcmd 0x0091 0x1C19   0x019C 0x0BB0 
#          MOVBLK    0x0514 0x1800  0x0226 0x4000  0x0800 0x0000
tcblock mbipcmd 0x0091 0x1C1B   0x0164 0x0514 0x1800 0x0226 \
                                0x4000 0x0800 0x0000 
#          GOTO      &DODL
tcblock mbipcmd 0x0091 0x1C22   0x0156 0x1C36 
#;
#; downlinks header from page 2 as DPC FFFFFF11 for all other fram
#;
#TST20:    SETREGS   R2976  6  1  0x1000  0x4000       0  0xFFFF  
tcblock mbipcmd 0x0091 0x1C24   0x01B2 0x0BA0 0x0006 0x0001 \
                                0x1000 0x4000 0x0000 0xFFFF \
                                0xFF11 
#          HRDINIT   R2976
tcblock mbipcmd 0x0091 0x1C2D   0x019C 0x0BA0 
#          MOVBLK    0x0514 0x1000  0x0226 0x4000  0x0800 0x0000
tcblock mbipcmd 0x0091 0x1C2F   0x0164 0x0514 0x1000 0x0226 \
                                0x4000 0x0800 0x0000 
#;
#; downlinks 0x2000L; 3075 is R3, 3077 is R5
#;
#DODL:     BRANCHIF  R3075  &DONE
tcblock mbipcmd 0x0091 0x1C36   0x015A 0x0C03 0x1C42 
#	  SETREGS   R3100  2  2000  0
tcblock mbipcmd 0x0091 0x1C39   0x01B2 0x0C1C 0x0002 0x07D0 \
                                0x0000 
#          START1HR  3     0x4000  R3100
tcblock mbipcmd 0x0091 0x1C3E   0x0174 0x0003 0x4000 0x0C1C 
#;
#DONE:
#          END
tcblock mbipcmd 0x0091 0x1C42   0x01FC 
#;------------------------------------------------------------
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
