# File: comp5k.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; COMP5K
#;
#QPROG_COMP5KFILL::
#; Program to downlink raw and compressed fill pattern data via 
#; the 5k channel
#;
#; Note: Prior to invoking this program:
#; 	request 5k telemetry (req sci5k), 
#; 	enable DEP interrupts (ENBIRPT - mbipldin,0004,0x134) 
#; 	and set DEP mode to 3 (mbdpmod 3).
#;   
#    FILLBLK  1:0x00000  1024L  0x0000
tcblock mbipcmd 0x0091 0x1C43   0x016C 0x0000 0x0800 0x0400 \
                                0x0000 0x0000 
#    FILLBLK  1:0x00400  1024L  0x1111
tcblock mbipcmd 0x0091 0x1C49   0x016C 0x0400 0x0800 0x0400 \
                                0x0000 0x1111 
#    FILLBLK  1:0x00800  1024L  0x2222
tcblock mbipcmd 0x0091 0x1C4F   0x016C 0x0800 0x0800 0x0400 \
                                0x0000 0x2222 
#    FILLBLK  1:0x00C00  1024L  0x3333
tcblock mbipcmd 0x0091 0x1C55   0x016C 0x0C00 0x0800 0x0400 \
                                0x0000 0x3333 
#    FILLBLK  1:0x01000  1024L  0x4444
tcblock mbipcmd 0x0091 0x1C5B   0x016C 0x1000 0x0800 0x0400 \
                                0x0000 0x4444 
#    FILLBLK  1:0x01400  1024L  0x5555
tcblock mbipcmd 0x0091 0x1C61   0x016C 0x1400 0x0800 0x0400 \
                                0x0000 0x5555 
#    FILLBLK  1:0x01800  1024L  0x6666
tcblock mbipcmd 0x0091 0x1C67   0x016C 0x1800 0x0800 0x0400 \
                                0x0000 0x6666 
#    FILLBLK  1:0x01C00  1024L  0x7777
tcblock mbipcmd 0x0091 0x1C6D   0x016C 0x1C00 0x0800 0x0400 \
                                0x0000 0x7777 
#    FILLBLK  1:0x02000  1024L  0x8888
tcblock mbipcmd 0x0091 0x1C73   0x016C 0x2000 0x0800 0x0400 \
                                0x0000 0x8888 
#    FILLBLK  1:0x02400  1024L  0x9999
tcblock mbipcmd 0x0091 0x1C79   0x016C 0x2400 0x0800 0x0400 \
                                0x0000 0x9999 
#    FILLBLK  1:0x02800  1024L  0xAAAA
tcblock mbipcmd 0x0091 0x1C7F   0x016C 0x2800 0x0800 0x0400 \
                                0x0000 0xAAAA 
#    FILLBLK  1:0x02C00  1024L  0xBBBB
tcblock mbipcmd 0x0091 0x1C85   0x016C 0x2C00 0x0800 0x0400 \
                                0x0000 0xBBBB 
#    FILLBLK  1:0x03000  1024L  0xC123
tcblock mbipcmd 0x0091 0x1C8B   0x016C 0x3000 0x0800 0x0400 \
                                0x0000 0xC123 
#    FILLBLK  1:0x03400  1024L  0xD456
tcblock mbipcmd 0x0091 0x1C91   0x016C 0x3400 0x0800 0x0400 \
                                0x0000 0xD456 
#    FILLBLK  1:0x03800  1024L  0xE789
tcblock mbipcmd 0x0091 0x1C97   0x016C 0x3800 0x0800 0x0400 \
                                0x0000 0xE789 
#    FILLBLK  1:0x03C00  1024L  0xFABC
tcblock mbipcmd 0x0091 0x1C9D   0x016C 0x3C00 0x0800 0x0400 \
                                0x0000 0xFABC 
#;
#SCIOP:
#    LRDINIT  0x3500                     ; Make directory in Page 
tcblock mbipcmd 0x0091 0x1CA3   0x018E 0x3500 
#;
#;   LRDXFR   R192
#;      NpixTotal          0x0000L
#;      NpixSeg            0
#;      Seqment            1
#;      Source             1:0x00000
#;      MaxSource          8192
#;      N                  0
#;      K                  0
#;      SegLength          8192
#;      DPID               0xFFFFFFB8L
#;      NPixImage          0x2000L
#;
#    SETREGS  R192  9  0 0 0 1 0 0x0800 8192 0 0 
tcblock mbipcmd 0x0091 0x1CA5   0x01B2 0x00C0 0x0009 0x0000 \
                                0x0000 0x0000 0x0001 0x0000 \
                                0x0800 0x2000 0x0000 0x0000 
#    SETREGS  R201  5 8192 0xFFFF 0xFFB8 8192 0
tcblock mbipcmd 0x0091 0x1CB1   0x01B2 0x00C9 0x0005 0x2000 \
                                0xFFFF 0xFFB8 0x2000 0x0000 
#    LRDXFR   R192
tcblock mbipcmd 0x0091 0x1CB9   0x0198 0x00C0 
#;
#; Output same data in compressed form using two 4096 pixel segmen
#; because compression requires buffer space.
#;
#;   LRDXFR   R192	  Was		Is
#;      NpixTotal          0x0000L	
#;      NpixSeg            0		
#;      Seqment            1		2
#;      Source             1:0x00000	
#;      MaxSource          4096		8192
#;      N                  14		
#;      K                  5		
#;      SegLength          4096		
#;      DPID               0xFFFFFFB8L
#;      NPixImage          0x1000L	0x2000L
#;
#    SETREGS  R192  9  0 0 0 2 0 0x0800 8192 14 5 
tcblock mbipcmd 0x0091 0x1CBB   0x01B2 0x00C0 0x0009 0x0000 \
                                0x0000 0x0000 0x0002 0x0000 \
                                0x0800 0x2000 0x000E 0x0005 
#    SETREGS  R201  5 4096 0xFFFF 0xFFB9 8192 0
tcblock mbipcmd 0x0091 0x1CC7   0x01B2 0x00C9 0x0005 0x1000 \
                                0xFFFF 0xFFB9 0x2000 0x0000 
#    LRDXFR   R192
tcblock mbipcmd 0x0091 0x1CCF   0x0198 0x00C0 
#    LRDXFR   R192		; add second call to transfer other half
tcblock mbipcmd 0x0091 0x1CD1   0x0198 0x00C0 
#;
#    LRDEND
tcblock mbipcmd 0x0091 0x1CD3   0x0196 
#    SETIRPT  1
tcblock mbipcmd 0x0091 0x1CD4   0x014E 0x0001 
#    END
tcblock mbipcmd 0x0091 0x1CD6   0x01FC 
#;
#;------------------------------------------------------------
#;
#QPROG_COMP5KIMAGE::
#    SETREGS  R69   2  0          0
tcblock mbipcmd 0x0091 0x1CD7   0x01B2 0x0045 0x0002 0x0000 \
                                0x0000 
#    SETREGS  R168  8  0:0x00514  1:0x00000  1024  1024  1040  R69
tcblock mbipcmd 0x0091 0x1CDC   0x01B2 0x00A8 0x0008 0x0514 \
                                0x0000 0x0000 0x0800 0x0400 \
                                0x0400 0x0410 0x0045 
#    EXTRACT  R168
tcblock mbipcmd 0x0091 0x1CE7   0x017A 0x00A8 
#;
#    GOTO     &SCIOP
tcblock mbipcmd 0x0091 0x1CE9   0x0156 0x1CA3 
#;
#;============================================================
#
#
#
#
#
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
