# File: genvldc.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/genvldc.src"
descr  "genvldc - load macro to generate observables"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
# ; An IP Test Program to construct the following observabls;
# ;         Velocity
# ;         Line Depth
# ;         Continuum
# ;
# ; The program expects that the DEP sequence has created the quantities 
# ; Sa, Sc, Sd and Si in IP memory pages 0 - 3.
# ; Pages 8 and 9 are used for downlinking the data products.
# ;------------------------------------------------------------------
# ;
# ; Downlink Square-Root Table
#     SETREGS 512 6 1 0x0000 0x4000 0 0xFFFF 0xFF70
tcblock mbipcmd 0x0091 0x0100   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF70 
#     HRDINIT 512
tcblock mbipcmd 0x0091 0x0109   0x019C 0x0200 
#     SETREGS 518 2 0x8225 0
tcblock mbipcmd 0x0091 0x010B   0x01B2 0x0206 0x0002 0x8225 \
                                0x0000 
#     MOVBLK 0 0x8009 550 0x4000 0x8000 0
tcblock mbipcmd 0x0091 0x0110   0x0164 0x0000 0x8009 0x0226 \
                                0x4000 0x8000 0x0000 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0117   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x011B   0x01FC 
# ;
# ; Downlink Reciprocal Table
#     SETREGS 512 6 1 0x0000 0x4000 0 0xFFFF 0xFF71
tcblock mbipcmd 0x0091 0x011C   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF71 
#     HRDINIT 512
tcblock mbipcmd 0x0091 0x0125   0x019C 0x0200 
#     SETREGS 518 2 0x8225 0
tcblock mbipcmd 0x0091 0x0127   0x01B2 0x0206 0x0002 0x8225 \
                                0x0000 
#     MOVBLK 0 0x800A 550 0x4000 0x8000 0
tcblock mbipcmd 0x0091 0x012C   0x0164 0x0000 0x800A 0x0226 \
                                0x4000 0x8000 0x0000 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0133   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x0137   0x01FC 
# ;
# ; Downlink Velocity Table
#     SETREGS 512 6 1 0x0000 0x4000 0 0xFFFF 0xFF72
tcblock mbipcmd 0x0091 0x0138   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF72 
#     HRDINIT 512
tcblock mbipcmd 0x0091 0x0141   0x019C 0x0200 
#     SETREGS 518 2 0x8225 0
tcblock mbipcmd 0x0091 0x0143   0x01B2 0x0206 0x0002 0x8225 \
                                0x0000 
#     MOVBLK 0x8000 0x800A 550 0x4000 0x8000 0
tcblock mbipcmd 0x0091 0x0148   0x0164 0x8000 0x800A 0x0226 \
                                0x4000 0x8000 0x0000 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x014F   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x0153   0x01FC 
# ;
# ;
# ;
# ; 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 0x0154   0x01B2 0x0045 0x0002 0x0000 \
                                0x0000 
# ;
# ; Downlink Sa (F1-F3)
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x0159   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x0162   0x019C 0x0200 
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x0164   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
#     SETREGS  R811  8   1300 0x0000  0x0226 0x4000  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x0169   0x01B2 0x032B 0x0008 0x0514 \
                                0x0000 0x0226 0x4000 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R811
tcblock mbipcmd 0x0091 0x0174   0x017A 0x032B 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0176   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x017A   0x01FC 
# ;
# ; Downlink Sc -(F2-F4)
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x017B   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x0184   0x019C 0x0200 
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x0186   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
#     SETREGS  R811  8   1300 0x0800  0x0226 0x4000  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x018B   0x01B2 0x032B 0x0008 0x0514 \
                                0x0800 0x0226 0x4000 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R811
tcblock mbipcmd 0x0091 0x0196   0x017A 0x032B 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0198   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x019C   0x01FC 
# ;
# ; Downlink Sd (F1 + F2 + F3 + F4)
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x019D   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x01A6   0x019C 0x0200 
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x01A8   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
#     SETREGS  R811  8   1300 0x1000  0x0226 0x4000  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x01AD   0x01B2 0x032B 0x0008 0x0514 \
                                0x1000 0x0226 0x4000 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R811
tcblock mbipcmd 0x0091 0x01B8   0x017A 0x032B 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x01BA   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x01BE   0x01FC 
# ;
# ; Downlink Si (Fc)
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x01BF   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x01C8   0x019C 0x0200 
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x01CA   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
#     SETREGS  R811  8   1300 0x1800  0x0226 0x4000  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x01CF   0x01B2 0x032B 0x0008 0x0514 \
                                0x1800 0x0226 0x4000 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R811
tcblock mbipcmd 0x0091 0x01DA   0x017A 0x032B 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x01DC   0x0174 0x0003 0x4000 0x0206 
#     END
tcblock mbipcmd 0x0091 0x01E0   0x01FC 
# ;
# ;
# ; 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 0x01E1   0x01B2 0x0045 0x0002 0x0000 \
                                0x0000 
# ;...................................................
# ;
# ;
# ; Velocity:
# ;       Source Page Sa   : Page 0, Offset 1300
# ;       Source Page Sc   : Page 1, Offset 1300
# ;       Destination Page : Page 4, Offset 0
# ;       Shift Count      :  2  (Sum of 4 images)
# ;       Block Count      :  15
# ;
#     SETREGS    R800     8   1300 0x0000   1300 0x0800   0 0x2000   2  15 
tcblock mbipcmd 0x0091 0x01E6   0x01B2 0x0320 0x0008 0x0514 \
                                0x0000 0x0514 0x0800 0x0000 \
                                0x2000 0x0002 0x000F 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01F1   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01F3   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01F5   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01F7   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01F9   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01FB   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01FD   0x017C 0x0320 
#     VLCTY      R800
tcblock mbipcmd 0x0091 0x01FF   0x017C 0x0320 
# ;
# ; Downlink Velocity:
# ;   HRDINIT
# ;    Source Address      : Page 0, Offset 1
# ;    Destination Page    : Page 8
# ;    n, k Parameters     : 0, 0
# ;    DPC                 : 0xFFFF 0xFFA0
# ;
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x0201   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x020A   0x019C 0x0200 
# ;
# ;   Load length in R518
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x020C   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
# ;
# ;   Copy Velocity from page 4 to page 8
#     MOVBLK  0 0x2000  550 0x4000  0x0000  0x0010
tcblock mbipcmd 0x0091 0x0211   0x0164 0x0000 0x2000 0x0226 \
                                0x4000 0x0000 0x0010 
# ;
# ;   Start Hi-Rate 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0218   0x0174 0x0003 0x4000 0x0206 
# ;
#     END
tcblock mbipcmd 0x0091 0x021C   0x01FC 
# ;......................................................
# ;
# ; Line Depth:
# ;       Source Page Sa   : Page 0, Offset 1300
# ;       Source Page Sc   : Page 1, Offset 1300
# ;       Destination Page : Page 5, Offset 0
# ;       Shift Count      :  4  (Pick a number!!)
# ;       Block Count      : 31  (Process 1/4 data per call ~150ms)
# ;       Lookup Seqgment  :  9  (Depends on SQRT table location)
# ;
#     SETREGS   R808 9  1300 0x0000  1300 0x0800  0 0x2800  4  31  9
tcblock mbipcmd 0x0091 0x021D   0x01B2 0x0328 0x0009 0x0514 \
                                0x0000 0x0514 0x0800 0x0000 \
                                0x2800 0x0004 0x001F 0x0009 
#     LDEPTH    R808
tcblock mbipcmd 0x0091 0x0229   0x017E 0x0328 
#     LDEPTH    R808
tcblock mbipcmd 0x0091 0x022B   0x017E 0x0328 
#     LDEPTH    R808
tcblock mbipcmd 0x0091 0x022D   0x017E 0x0328 
#     LDEPTH    R808
tcblock mbipcmd 0x0091 0x022F   0x017E 0x0328 
# ;
# ; Downlink Line Depth:
# ;   HRDINIT
# ;    Source Address      : Page 0, Offset 1
# ;    Destination Page    : Page 8
# ;    n, k Parameters     : 0, 0
# ;    DPC                 : 0xFFFF 0xFF04
# ;
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x0231   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x023A   0x019C 0x0200 
# ;
# ;   Load length in R518
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x023C   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
# ;
# ;   Copy Line Depth from page 5 to page 8
#     MOVBLK  0 0x2800  550 0x4000  0x0000  0x0010
tcblock mbipcmd 0x0091 0x0241   0x0164 0x0000 0x2800 0x0226 \
                                0x4000 0x0000 0x0010 
# ;
# ;   Start Hi-Rate 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x0248   0x0174 0x0003 0x4000 0x0206 
# ;
#     END
tcblock mbipcmd 0x0091 0x024C   0x01FC 
# ;
# ;.....................................................
# ;      
# ; Continuum:
# ;    Extract 1024^2 Sd from page 2 to page 6
# ;      Source Page       : page 2, Offset 1300
# ;      Destination       : Page 6, Offset 0
# ;      X-Length          : 1024
# ;      Y-Length          : 1024
# ;      Row Length        : 1040
# ;      Global Offset Reg.:   69
# ;
#     SETREGS  R811  8   1300 0x1000  0x0000 0x3000  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x024D   0x01B2 0x032B 0x0008 0x0514 \
                                0x1000 0x0000 0x3000 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R811
tcblock mbipcmd 0x0091 0x0258   0x017A 0x032B 
# ;
# ;   Extract 1024^2 Si from page 3 to page 7
# ;      Source Page       : page 3, Offset 1300
# ;      Destination       : Page 7, Offset 0
# ;      X-Length          : 1024
# ;      Y-Length          : 1024
# ;      Row Length        : 1040
# ;      Global Offset Reg.:   69
# ;
#     SETREGS  R819  8   1300 0x1800  0x0000 0x3800  1024  1024  1040  69
tcblock mbipcmd 0x0091 0x025A   0x01B2 0x0333 0x0008 0x0514 \
                                0x1800 0x0000 0x3800 0x0400 \
                                0x0400 0x0410 0x0045 
#     EXTRACT  R819
tcblock mbipcmd 0x0091 0x0265   0x017A 0x0333 
# ;
# ;   Construct Continuum image from Sd, Si and Ld
# ;     Source (Si)       : Page 7, Offset 0
# ;     Source (Ld)       : Page 5, Offset 0
# ;     Source (Sd)       : Page 6, Offset 0
# ;     Destination       : Page 10, Offset 0
# ;     Block Count       :  63 (1/2 image processed, each call < 300 ms)
# ;     Cadc              : 200
# ;
#     SETREGS  R821  10  0 0x3800  0 0x2800  0 0x3000  0 0x5000  63  200
tcblock mbipcmd 0x0091 0x0267   0x01B2 0x0335 0x000A 0x0000 \
                                0x3800 0x0000 0x2800 0x0000 \
                                0x3000 0x0000 0x5000 0x003F \
                                0x00C8 
#     CNTNM    R821
tcblock mbipcmd 0x0091 0x0274   0x0182 0x0335 
#     CNTNM    R821
tcblock mbipcmd 0x0091 0x0276   0x0182 0x0335 
# ;
# ; Downlink Continuum:
# ;   HRDINIT
# ;    Source Address      : Page 0, Offset 1
# ;    Destination Page    : Page 8
# ;    n, k Parameters     : 0, 0
# ;    DPC                 : 0xFFFF 0xFF04
# ;
#     SETREGS  512  6  1 0x0000  0x4000  0  0xFFFF 0xFF04
tcblock mbipcmd 0x0091 0x0278   0x01B2 0x0200 0x0006 0x0001 \
                                0x0000 0x4000 0x0000 0xFFFF \
                                0xFF04 
#     HRDINIT  512
tcblock mbipcmd 0x0091 0x0281   0x019C 0x0200 
# ;
# ;   Load length in R518
#     SETREGS  518  2  0x0226  0x0010
tcblock mbipcmd 0x0091 0x0283   0x01B2 0x0206 0x0002 0x0226 \
                                0x0010 
# ;
# ;   Copy Continuum from page 10 to page 8
#     MOVBLK  0 0x5000  550 0x4000  0x0000  0x0010
tcblock mbipcmd 0x0091 0x0288   0x0164 0x0000 0x5000 0x0226 \
                                0x4000 0x0000 0x0010 
# ;
# ;   Start Hi-Rate 
#     START1HR  3  0x4000  R518
tcblock mbipcmd 0x0091 0x028F   0x0174 0x0003 0x4000 0x0206 
# ;
#     END
tcblock mbipcmd 0x0091 0x0293   0x01FC 
# ;
# ;============================================================
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
