# File: iprload.src
#
program "@(#) MODULE: iprload.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/iprload.src"
descr "iprload - load IP registers"

display "Executing procedure iprload."
write  !GS9 "Executing procedure iprload :"
write  !GS9 " %s" !DATE
writen !GS9 " %s" !TIME
writen !GS9 " "

tcblock mbdpmod 1               ## Set DEP 5k to engineering mode

# clear accumulation buffers for time weighted averages

tcblock mbipldin 0x16c 0x0000 0x5800 0x0000 0x0010 0x0020  ## LF #1
wait time 5
tcblock mbipldin 0x16c 0x0000 0x6000 0x0000 0x0010 0x0050  ## MP #1
wait time 5
tcblock mbipldin 0x16c 0x0000 0x6800 0x0000 0x0010 0x0068  ## MP #2
wait time 5
tcblock mbipldin 0x16c 0x0000 0x7000 0x0000 0x0010 0x0070  ## FB #1
wait time 5
tcblock mbipldin 0x16c 0x0000 0x7800 0x0000 0x0010 0x0088  ## FB #2
wait time 5

tcblock mbipldin 0x140 26  0      ## Set SAVEMODE enable flag
tcblock mbipldin 0x140 28  1      ## Clear SAVEMODE execute flag
tcblock mbipldin 0x1b2 69  2 0 0  ## Offsets
tcblock mbipldin 0x1b2 560 2 0 0  ## R550-R551 set DPC len = 1
wait time 5

tcblock mbipldin 0x140 1130  1    ## Set initialization flag for REGDP
tcblock mbipldin 0x140 1134  1348
tcblock mbipldin 0x140 1135  0
tcblock mbipldin 0x140 1138  1387
tcblock mbipldin 0x140 1139  0
tcblock mbipldin 0x11C            ## Initialize subroutine stack

tcblock mbipldin 0x1b2 96 2 0x0000 0x2800
tcblock mbipldin 0x1b2 98 2 0x0000 0x0000
tcblock mbipldin 0x140 1212 0x0102	## Initialize structure

tcblock mbipldin 0x140 1267 0x0134  ## IPRL_STR_STRT60 = &INIT30 
tcblock mbipldin 0x140 3016 0x0902  ## Set flag to do mag init
tcblock mbipldin 0x140 1348      0  ## Clear ALT repts counter
tcblock mbipldin 0x140 1349      5  ## Set ALT Repeats value
tcblock mbipldin 0x140 1377      0  ## Set 5K Magnetogram size to zero 
wait time 3

# Initialize Error Log
tcblock mbipldin 0x01b2 464 3  0x0000  0x2011 4800
tcblock mbipldin 0x01EC 464

# Set IP vectors 
tcblock  mbipldin 0x154
 
tcblock mbipcmd 0x91  0 0x1F00     ## Heritage Load Replacement Programs
tcblock mbipcmd 0x91  1 0x0100     ## Prime60 / Prime30
tcblock mbipcmd 0x91  2 0x0100
tcblock mbipcmd 0x91  3 0x0100
tcblock mbipcmd 0x91  4 0x0132
tcblock mbipcmd 0x91  5 0x0900     ## ALT30
tcblock mbipcmd 0x91  6 0x0E83
tcblock mbipcmd 0x91  7 0x0B00     ## HDR
tcblock mbipcmd 0x91  8 0x0B04     ## TAIL
tcblock mbipcmd 0x91 10 0x1E38     ## DMPMEM
tcblock mbipcmd 0x91 11 0x1CD7     ## COMP5KIMAGE
tcblock mbipcmd 0x91 12 0x1D00     ## IPTST

wait time 3

tcblock mbipldin 0x136		## enable macro queue X2000

tcblock mbdpmod 3              ## Set 5k mode
wait time 3			## 5kstatus byte mkdpmd (1=0, 3=3)

tcblock mbipldin 0x134         ## Enable interrupts
wait time 3

display "Finished procedure iprload"
return
