# File: ip_test.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/ip_test.src"
descr  "ip_test  - load IP data product test macro"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
# ; An IP Test Program to take an image and downlink the following 
# ; data products using the high rate channel;
# ;          - downlink image 
# ;          - crop list
# ;          - Limb Figure List
# ;          - Croped Image
# ;          - Limb Figure Image
# ;          - Rectangular Bins
# ;          - Rectngular Binned Data
# ;          - Vector Bins
# ;          - Vector Binned Data
# ;          - Vector Binned Data in 5k channel
# ;
# ;------------------------------------------------------------------
# ;
# ; Initialize Global Offest Register (R69 and R70). This register is used by
# ; several instructions to determine the center of the Sun.
#     SETREGS    R69      2      0    0
tcblock mbipcmd 0x0091 0x0100   0x01B2 0x0045 0x0002 0x0000 \
                                0x0000 
# ;
# ; Extract the image from the camera frame. The camera frame is assumed to be
# ; in page 0. The extracted image is saved in page 1, offset 0.
#     SETREGS    R800     8   1300    0     0  0x0800  1024  1024  1040  R69
tcblock mbipcmd 0x0091 0x0105   0x01B2 0x0320 0x0008 0x0514 \
                                0x0000 0x0000 0x0800 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT    R800
tcblock mbipcmd 0x0091 0x0110   0x017A 0x0320 
# ;
# ; Copy image to output buffer. (Page 1:0 to 8:550)
#     MOVBLK        0    0x0800   550   0x4000  0xFFFF  0x000F
tcblock mbipcmd 0x0091 0x0112   0x0164 0x0000 0x0800 0x0226 \
                                0x4000 0xFFFF 0x000F 
# ;
# ; Iniitalize high rate from mem 8
#     SETREGS    R512      6       1      0  0x4000       0  0xFFFF  0xFF04
tcblock mbipcmd 0x0091 0x0119   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT    R512
tcblock mbipcmd 0x0091 0x0122   0x019C 0x0200 
# ;
# ; Load page 8 length to registers 524-525 
#     SETREGS    R518      2  550 0x0010
tcblock mbipcmd 0x0091 0x0124   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
# ;
# ; Start hi-rate downlink of page 8 (Raw Image) 
#     START1HR   0x03  0x4000  R518
tcblock mbipcmd 0x0091 0x0129   0x0174 0x0003 0x4000 0x0206 
# ;
#     END
tcblock mbipcmd 0x0091 0x012D   0x01FC 
# ;
# ;..............................................................
# ;
# ;                        CROPPED IMAGE
# ;
# ;
# ; Copy CROPLIST from page 17 (0x8800) to page 8 (0x4000)
#     MOVBLK     0  0x8800  550  0x4000  3500  0
tcblock mbipcmd 0x0091 0x012E   0x0164 0x0000 0x8800 0x0226 \
                                0x4000 0x0DAC 0x0000 
# ;
# ; Crop image in [1:0000] and move to page [9:0226]
#     SETREGS   R808       8  0x0800   0x0226  0x4800  0  1000  0  0x8800  69
tcblock mbipcmd 0x0091 0x0135   0x01B2 0x0328 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x03E8 \
                                0x0000 0x8800 0x0045 
#     CROP      R808
tcblock mbipcmd 0x0091 0x0140   0x0178 0x0328 
# ;
# ; Initialize page 8 for hi-rate downlink 
#     SETREGS    R520      6  1  0  0x4000  0  0xFFFF  0xFF73
tcblock mbipcmd 0x0091 0x0142   0x01B2 0x0208 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF73 
#     HRDINIT    R520
tcblock mbipcmd 0x0091 0x014B   0x019C 0x0208 
# ;
# ; Iniitalize high rate from mem 9
#     SETREGS    R526      6  1  0  0x4800  0  0xFFFF  0xFF93
tcblock mbipcmd 0x0091 0x014D   0x01B2 0x020E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF93 
#     HRDINIT    R526
tcblock mbipcmd 0x0091 0x0156   0x019C 0x020E 
# ;
# ; Load page 8 length to registers 532-533 
#     SETREGS    R532      2  4100  0
tcblock mbipcmd 0x0091 0x0158   0x01B2 0x0214 0x0002 0x1004 \
                                0x0000 
# ;
# ; Load page 9 length into R534-R535
#     SETREGS    R534      2  0x0000  0x000C
tcblock mbipcmd 0x0091 0x015D   0x01B2 0x0216 0x0002 0x0000 \
                                0x000C 
# ;
# ; Start hi-rate downlink of page 8 (Crop List) 
# ; and page 9 (Cropped image)
#     START2HR   0x4B  0x4000  0x4800   R532   R534
tcblock mbipcmd 0x0091 0x0162   0x019A 0x004B 0x4000 0x4800 \
                                0x0214 0x0216 
# ;
#     END
tcblock mbipcmd 0x0091 0x0168   0x01FC 
# ;
# ;.............................................................
# ;
# ;                        LIMB FIGURE
# ;
# ; Copy Limb Figure List from [11:1000] to [8:0226]
#     MOVBLK     0x1000  0x8800  0x0226  0x4000  6500  0
tcblock mbipcmd 0x0091 0x0169   0x0164 0x1000 0x8800 0x0226 \
                                0x4000 0x1964 0x0000 
# ;
# ; Construct Limb Figure from image in [0:04FC] into page [9:0226]
#     SETREGS   R816    8  0x0800   0x0226  0x4800  0  2000 0x1000 0x8800  69
tcblock mbipcmd 0x0091 0x0170   0x01B2 0x0330 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x07D0 \
                                0x1000 0x8800 0x0045 
#     CROP      R816
tcblock mbipcmd 0x0091 0x017B   0x0178 0x0330 
# ;
# ;
# ; Initialize page 8 for hi-rate downlink 
#     SETREGS    R536      6  1  0  0x4000  0x0000  0xFFFF  0xFF74
tcblock mbipcmd 0x0091 0x017D   0x01B2 0x0218 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF74 
#     HRDINIT    R536
tcblock mbipcmd 0x0091 0x0186   0x019C 0x0218 
# ;
# ; Iniitalize high rate from mem 9
#     SETREGS    R542      6  1  0  0x4800       0  0xFFFF  0xFF94
tcblock mbipcmd 0x0091 0x0188   0x01B2 0x021E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF94 
#     HRDINIT    R542
tcblock mbipcmd 0x0091 0x0191   0x019C 0x021E 
# ;
# ; Load page 8 length to registers 548-549 
#     SETREGS    R548      2  7100     0
tcblock mbipcmd 0x0091 0x0193   0x01B2 0x0224 0x0002 0x1BBC \
                                0x0000 
# ;
# ; Load page 9 length to registers 580-581
#     COPYREG   R188  R580
tcblock mbipcmd 0x0091 0x0198   0x0142 0x00BC 0x0244 
#     COPYREG   R189  R581
tcblock mbipcmd 0x0091 0x019B   0x0142 0x00BD 0x0245 
#     ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x019E   0x01BC 0x0244 0x0226 
# ;
# ; Start hi-rate downlink of page 8 (Crop List) 
# ; and page 9 (Cropped image)
#     START2HR   0x4B  0x4000  0x4800   R548   R580
tcblock mbipcmd 0x0091 0x01A1   0x019A 0x004B 0x4000 0x4800 \
                                0x0224 0x0244 
# ;
#     END
tcblock mbipcmd 0x0091 0x01A7   0x01FC 
# ;
# ;...........................................................
# ;
# ;
# ;
# ;
# ; RWBIN  (Line Depth)
# ;
# ;
# ; It is assumed that the Rectangular bin list has already 
# ; been loaded and that the R208 was used to save Low Rate 
# ; Data parameters.
# ;
# ;
# ; Copy Line Depth List to mem 9
#     MOVBLK     0x1000  0x8801  0x0226 0x4000  30000  0
tcblock mbipcmd 0x0091 0x01A8   0x0164 0x1000 0x8801 0x0226 \
                                0x4000 0x7530 0x0000 
# ; 
# ;
# ; Construct rectangular binned image 
#     SETREGS    R824  8  0x0800  0x0226  0x4800  0  0x0008  0x1000  0x8801  69
tcblock mbipcmd 0x0091 0x01AF   0x01B2 0x0338 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x0008 \
                                0x1000 0x8801 0x0045 
#     RWBIN      R824
tcblock mbipcmd 0x0091 0x01BA   0x01A0 0x0338 
#     RWBIN      R824
tcblock mbipcmd 0x0091 0x01BC   0x01A0 0x0338 
#     RWBIN      R824
tcblock mbipcmd 0x0091 0x01BE   0x01A0 0x0338 
# ;
# ; Initialize page 8 for hi-rate downlink 
# ;                    
#     SETREGS    R552      6  1  0  0x4000  0x0000  0xFFFF  0xFF76
tcblock mbipcmd 0x0091 0x01C0   0x01B2 0x0228 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF76 
#     HRDINIT    R552
tcblock mbipcmd 0x0091 0x01C9   0x019C 0x0228 
# ;
# ; Iniitalize high rate from mem 9
#     SETREGS    R558      6  1  0  0x4800       0  0xFFFF  0xFF96
tcblock mbipcmd 0x0091 0x01CB   0x01B2 0x022E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF96 
#     HRDINIT    R558
tcblock mbipcmd 0x0091 0x01D4   0x019C 0x022E 
# ;
# ; Load page 8 length to registers 564-565 
#     SETREGS    R564      2  30550  0
tcblock mbipcmd 0x0091 0x01D6   0x01B2 0x0234 0x0002 0x7756 \
                                0x0000 
# ;
# ; Load page 9 length to registers 580-581
#     COPYREG   R220  R580
tcblock mbipcmd 0x0091 0x01DB   0x0142 0x00DC 0x0244 
#     COPYREG   R221  R581
tcblock mbipcmd 0x0091 0x01DE   0x0142 0x00DD 0x0245 
#     ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x01E1   0x01BC 0x0244 0x0226 
# ;
# ; Start hi-rate downlink of 
# ; page 8 (Raw Image) and page 9 (Lists and Data Products)
#     START2HR   0x4B  0x4000  0x4800   R564   R580   ; R208 
tcblock mbipcmd 0x0091 0x01E4   0x019A 0x004B 0x4000 0x4800 \
                                0x0234 0x0244 
# ;
#     END
tcblock mbipcmd 0x0091 0x01EA   0x01FC 
# ;
# ;............................................................
# ;
# ;
# ;
# ; VWBIN  (Medium-l)
# ;
# ; It is assumed that the X, Y vectors and the Vector bin lists 
# ; have already been loaded and that the Vector bin load command 
# ; used R192 to save Low Rate Data parameters.
# ;
# ;
# ; Copy Vector Bin List to page [8:0226]
#     MOVBLK     0x7000  0x8800  0x0226  0x4000  42000  0
tcblock mbipcmd 0x0091 0x01EB   0x0164 0x7000 0x8800 0x0226 \
                                0x4000 0xA410 0x0000 
# ;
# ; Construct vector weighted binned image 
#     SETREGS    R832  8  0x0800  0x0226  0x4800  0  0x0008  0x7000  0x8800  69
tcblock mbipcmd 0x0091 0x01F2   0x01B2 0x0340 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x0008 \
                                0x7000 0x8800 0x0045 
#     VWBIN      R832
tcblock mbipcmd 0x0091 0x01FD   0x019E 0x0340 
#     VWBIN      R832
tcblock mbipcmd 0x0091 0x01FF   0x019E 0x0340 
#     VWBIN      R832
tcblock mbipcmd 0x0091 0x0201   0x019E 0x0340 
#     VWBIN      R832
tcblock mbipcmd 0x0091 0x0203   0x019E 0x0340 
#     VWBIN      R832
tcblock mbipcmd 0x0091 0x0205   0x019E 0x0340 
# ;
# ;
# ; Initialize page 8 for hi-rate downlink 
# ;                    
#     SETREGS    R566      6  1  0  0x4000  0x0000  0xFFFF  0xFF75
tcblock mbipcmd 0x0091 0x0207   0x01B2 0x0236 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF75 
#     HRDINIT    R566
tcblock mbipcmd 0x0091 0x0210   0x019C 0x0236 
# ;
# ; Iniitalize high rate from mem 9
#     SETREGS    R572      6  1  0  0x4800       0  0xFFFF  0xFF95
tcblock mbipcmd 0x0091 0x0212   0x01B2 0x023C 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF95 
#     HRDINIT    R572
tcblock mbipcmd 0x0091 0x021B   0x019C 0x023C 
# ;
# ; Load page 8 length to registers 578-579 
#     SETREGS    R578      2  42550  0
tcblock mbipcmd 0x0091 0x021D   0x01B2 0x0242 0x0002 0xA636 \
                                0x0000 
# ;
# ; Load page 9 length to registers 580-581
#     COPYREG   R204  R580
tcblock mbipcmd 0x0091 0x0222   0x0142 0x00CC 0x0244 
#     COPYREG   R205  R581
tcblock mbipcmd 0x0091 0x0225   0x0142 0x00CD 0x0245 
#     ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x0228   0x01BC 0x0244 0x0226 
# ;
# ; Start hi-rate downlink of 
# ; page 8 (Raw Image) and page 9 (Lists and Data Products)
#     START2HR   0x4B  0x4000  0x4800   R578   R580 
tcblock mbipcmd 0x0091 0x022B   0x019A 0x004B 0x4000 0x4800 \
                                0x0242 0x0244 
# ;
# ;
#     END
tcblock mbipcmd 0x0091 0x0231   0x01FC 
# ;............................................................
# ;
# ;   Downlink Medium-l data using the 5k channel
# ;
#     LRDINIT  0
tcblock mbipcmd 0x0091 0x0232   0x018E 0x0000 
#     LRDXFR   R192
tcblock mbipcmd 0x0091 0x0234   0x0198 0x00C0 
#     LRDEND
tcblock mbipcmd 0x0091 0x0236   0x0196 
#     END
tcblock mbipcmd 0x0091 0x0237   0x01FC 
# ;============================================================
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
