# File: iptstld.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/ip/iptstld.ips"
descr  "iptstld - load IP data product test macros"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; IP_TEST
#;
#; An IP Test Program to take an image and downlink the following 
#; data products using the high rate channel:
#;
#;          - Extracted Image 
#;          - Crop List
#;          - Croped Image
#;          - Limb Figure List
#;          - Limb Figure Image
#;          - Rectangular Bins
#;          - Rectangular Binned Data
#;          - Vector Bins
#;          - Vector Binned Data
#;          - ?Vector Binned Data in 5k channel?
#;
#;----------------------------------------------------------------
#;
#; IMAGE EXTRACT TEST
#;
#QPROG_IPTST::
#; Initialize Global Offest Register (R69 and R70). This register 
#; several instructions to determine the center of the Sun.
#    SETREGS    R69      2      0    0
tcblock mbipcmd 0x0091 0x1D00   0x01B2 0x0045 0x0002 0x0000 \
                                0x0000 
#;
#; Extract the image from the camera frame. The camera frame is as
#; in page 0. The extracted image is saved in page 1, offset 0.
#    SETREGS    R800     8   1300    0     0  0x0800  1024  1024  
tcblock mbipcmd 0x0091 0x1D05   0x01B2 0x0320 0x0008 0x0514 \
                                0x0000 0x0000 0x0800 0x0400 \
                                0x0400 0x0410 0x0045 
#    EXTRACT    R800
tcblock mbipcmd 0x0091 0x1D10   0x017A 0x0320 
#;
#; Copy image to output buffer. (Page 1:0 to 8:550)
#    MOVBLK        0    0x0800   550   0x4000  0xFFFF  0x000F
tcblock mbipcmd 0x0091 0x1D12   0x0164 0x0000 0x0800 0x0226 \
                                0x4000 0xFFFF 0x000F 
#;
#; Iniitalize high rate from mem 8
#    SETREGS    R512      6       1      0  0x4000       0  0xFFFF
tcblock mbipcmd 0x0091 0x1D19   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#    HRDINIT    R512
tcblock mbipcmd 0x0091 0x1D22   0x019C 0x0200 
#;
#; Load page 8 length to registers 524-525 
#    SETREGS    R518      2  550 0x0010
tcblock mbipcmd 0x0091 0x1D24   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
#;
#; Start hi-rate downlink of page 8 (Raw Image) 
#    START1HR   0x03  0x4000  R518
tcblock mbipcmd 0x0091 0x1D29   0x0174 0x0003 0x4000 0x0206 
#;
#    END
tcblock mbipcmd 0x0091 0x1D2D   0x01FC 
#;
#;..............................................................
#;
#; CROPPED IMAGE TEST
#;
#QPROG_CROPTST::
#; Copy CROPLIST from page 14 (0x7000) to page 8 (0x4000)
#    MOVBLK     0  0x7000  550  0x4000  3500  0
tcblock mbipcmd 0x0091 0x1D2E   0x0164 0x0000 0x7000 0x0226 \
                                0x4000 0x0DAC 0x0000 
#;
#; Crop image in [1:0000] and move to page [9:0226]
#    SETREGS   R808       8  0x0800   0x0226  0x4800  0  1000  0  
tcblock mbipcmd 0x0091 0x1D35   0x01B2 0x0328 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x03E8 \
                                0x0000 0x7000 0x0045 
#    CROP      R808
tcblock mbipcmd 0x0091 0x1D40   0x0178 0x0328 
#;
#; Initialize page 8 for hi-rate downlink 
#    SETREGS    R520      6  1  0  0x4000  0  0xFFFF  0xFF73
tcblock mbipcmd 0x0091 0x1D42   0x01B2 0x0208 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF73 
#    HRDINIT    R520
tcblock mbipcmd 0x0091 0x1D4B   0x019C 0x0208 
#;
#; Iniitalize high rate from mem 9
#    SETREGS    R526      6  1  0  0x4800  0  0xFFFF  0xFF93
tcblock mbipcmd 0x0091 0x1D4D   0x01B2 0x020E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF93 
#    HRDINIT    R526
tcblock mbipcmd 0x0091 0x1D56   0x019C 0x020E 
#;
#; Load page 8 length to registers 532-533 
#    SETREGS    R532      2  4100  0
tcblock mbipcmd 0x0091 0x1D58   0x01B2 0x0214 0x0002 0x1004 \
                                0x0000 
#;
#; Load page 9 length into R534-R535
#    SETREGS    R534      2  0x0000  0x000C
tcblock mbipcmd 0x0091 0x1D5D   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 0x1D62   0x019A 0x004B 0x4000 0x4800 \
                                0x0214 0x0216 
#;
#    END
tcblock mbipcmd 0x0091 0x1D68   0x01FC 
#;
#;.............................................................
#;
#; LIMB FIGURE TEST
#;
#QPROG_LFTST::
#; Copy Limb Figure List from [14:1000] to [8:0226]
#    MOVBLK     0x1000  0x7000  0x0226  0x4000  6500  0
tcblock mbipcmd 0x0091 0x1D69   0x0164 0x1000 0x7000 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 
tcblock mbipcmd 0x0091 0x1D70   0x01B2 0x0330 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x07D0 \
                                0x1000 0x7000 0x0045 
#    CROP      R816
tcblock mbipcmd 0x0091 0x1D7B   0x0178 0x0330 
#;
#;
#; Initialize page 8 for hi-rate downlink 
#    SETREGS    R536      6  1  0  0x4000  0x0000  0xFFFF  0xFF74
tcblock mbipcmd 0x0091 0x1D7D   0x01B2 0x0218 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF74 
#    HRDINIT    R536
tcblock mbipcmd 0x0091 0x1D86   0x019C 0x0218 
#;
#; Iniitalize high rate from mem 9
#    SETREGS    R542      6  1  0  0x4800       0  0xFFFF  0xFF94
tcblock mbipcmd 0x0091 0x1D88   0x01B2 0x021E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF94 
#    HRDINIT    R542
tcblock mbipcmd 0x0091 0x1D91   0x019C 0x021E 
#;
#; Load page 8 length to registers 548-549 
#    SETREGS    R548      2  7100     0
tcblock mbipcmd 0x0091 0x1D93   0x01B2 0x0224 0x0002 0x1BBC \
                                0x0000 
#;
#; Load page 9 length to registers 580-581
#    COPYREG   R188  R580
tcblock mbipcmd 0x0091 0x1D98   0x0142 0x00BC 0x0244 
#    COPYREG   R189  R581
tcblock mbipcmd 0x0091 0x1D9B   0x0142 0x00BD 0x0245 
#    ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x1D9E   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 0x1DA1   0x019A 0x004B 0x4000 0x4800 \
                                0x0224 0x0244 
#;
#    END
tcblock mbipcmd 0x0091 0x1DA7   0x01FC 
#;
#;...........................................................
#;
#; RWBIN TEST (Line Depth)
#;
#QPROG_RWBTST::
#; 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  0x7001  0x0226 0x4000  30000  0
tcblock mbipcmd 0x0091 0x1DA8   0x0164 0x1000 0x7001 0x0226 \
                                0x4000 0x7530 0x0000 
#; 
#; Construct rectangular binned image 
#    SETREGS    R824  8  0x0800  0x0226  0x4800  0  0x0008  0x1000
tcblock mbipcmd 0x0091 0x1DAF   0x01B2 0x0338 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x0008 \
                                0x1000 0x7001 0x0045 
#    RWBIN      R824
tcblock mbipcmd 0x0091 0x1DBA   0x01A0 0x0338 
#    RWBIN      R824
tcblock mbipcmd 0x0091 0x1DBC   0x01A0 0x0338 
#    RWBIN      R824
tcblock mbipcmd 0x0091 0x1DBE   0x01A0 0x0338 
#;
#; Initialize page 8 for hi-rate downlink 
#;                    
#    SETREGS    R552      6  1  0  0x4000  0x0000  0xFFFF  0xFF76
tcblock mbipcmd 0x0091 0x1DC0   0x01B2 0x0228 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF76 
#    HRDINIT    R552
tcblock mbipcmd 0x0091 0x1DC9   0x019C 0x0228 
#;
#; Iniitalize high rate from mem 9
#    SETREGS    R558      6  1  0  0x4800       0  0xFFFF  0xFF96
tcblock mbipcmd 0x0091 0x1DCB   0x01B2 0x022E 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF96 
#    HRDINIT    R558
tcblock mbipcmd 0x0091 0x1DD4   0x019C 0x022E 
#;
#; Load page 8 length to registers 564-565 
#    SETREGS    R564      2  30550  0
tcblock mbipcmd 0x0091 0x1DD6   0x01B2 0x0234 0x0002 0x7756 \
                                0x0000 
#;
#; Load page 9 length to registers 580-581
#    COPYREG   R220  R580
tcblock mbipcmd 0x0091 0x1DDB   0x0142 0x00DC 0x0244 
#    COPYREG   R221  R581
tcblock mbipcmd 0x0091 0x1DDE   0x0142 0x00DD 0x0245 
#    ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x1DE1   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 0x1DE4   0x019A 0x004B 0x4000 0x4800 \
                                0x0234 0x0244 
#;
#    END
tcblock mbipcmd 0x0091 0x1DEA   0x01FC 
#;
#;............................................................
#;
#; VWBIN TEST (Medium-l)
#;
#QPROG_VWBTST::
#; 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  0x7000  0x0226  0x4000  42000  0
tcblock mbipcmd 0x0091 0x1DEB   0x0164 0x7000 0x7000 0x0226 \
                                0x4000 0xA410 0x0000 
#;
#; Construct vector weighted binned image 
#    SETREGS    R832  8  0x0800  0x0226  0x4800  0  0x0008  0x7000
tcblock mbipcmd 0x0091 0x1DF2   0x01B2 0x0340 0x0008 0x0800 \
                                0x0226 0x4800 0x0000 0x0008 \
                                0x7000 0x7000 0x0045 
#    VWBIN      R832
tcblock mbipcmd 0x0091 0x1DFD   0x019E 0x0340 
#    VWBIN      R832
tcblock mbipcmd 0x0091 0x1DFF   0x019E 0x0340 
#    VWBIN      R832
tcblock mbipcmd 0x0091 0x1E01   0x019E 0x0340 
#    VWBIN      R832
tcblock mbipcmd 0x0091 0x1E03   0x019E 0x0340 
#    VWBIN      R832
tcblock mbipcmd 0x0091 0x1E05   0x019E 0x0340 
#;
#; Initialize page 8 for hi-rate downlink 
#;                    
#    SETREGS    R566      6  1  0  0x4000  0x0000  0xFFFF  0xFF75
tcblock mbipcmd 0x0091 0x1E07   0x01B2 0x0236 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF75 
#    HRDINIT    R566
tcblock mbipcmd 0x0091 0x1E10   0x019C 0x0236 
#;
#; Initialize high rate from mem 9
#    SETREGS    R572      6  1  0  0x4800       0  0xFFFF  0xFF95
tcblock mbipcmd 0x0091 0x1E12   0x01B2 0x023C 0x0006 0x0001 \
                                0x0000 0x4800 0x0000 0xFFFF \
                                0xFF95 
#    HRDINIT    R572
tcblock mbipcmd 0x0091 0x1E1B   0x019C 0x023C 
#;
#; Load page 8 length to registers 578-579 
#    SETREGS    R578      2  42550  0
tcblock mbipcmd 0x0091 0x1E1D   0x01B2 0x0242 0x0002 0xA636 \
                                0x0000 
#;
#; Load page 9 length to registers 580-581
#    COPYREG   R204  R580
tcblock mbipcmd 0x0091 0x1E22   0x0142 0x00CC 0x0244 
#    COPYREG   R205  R581
tcblock mbipcmd 0x0091 0x1E25   0x0142 0x00CD 0x0245 
#    ADDREGD   R580  550
tcblock mbipcmd 0x0091 0x1E28   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 0x1E2B   0x019A 0x004B 0x4000 0x4800 \
                                0x0242 0x0244 
#;
#    END
tcblock mbipcmd 0x0091 0x1E31   0x01FC 
#;============================================================
#
#
#
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
