#
# File : day_start_v03
# 
# History: Created by Joe Covington Oct.5, 1995
#	23-Oct-95 (MDM) - Changed DEP Reg 5 to be set to 0
#	24-Oct-95 (MDM) - Put protection in for case where GI2 is
#			  not defined (ie: is equal to zero)
#	 3-Nov-95 (MDM) - Changed the campaign to start with to be
#			  the VC2_OBS
#	20-Nov-95 (MDM) - Changed the cadence to be 96/factor+5 instead of
#			  simply 96/factor
#			  (since DEP definition changed)
#	 5-Dec-95 (MDM) - Removed the "perf reset" and "perf runstr" from
#			  the code
#	 7-Dec-95 (MDM) - Changed the campaign addresses to work with the
#			  new load method (and layout)
#	12-Dec-95 (MDM) - Added descr line and changed addresses again
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/prepsrc/day_start.src"
descr "Setup the registers before staring DAYTEST"

display "day_start"

if !GI2 = 0 then
   set !GI2 = 8			## set the speed factor
end if

tcblock mbipldin 0x140 8190  1  ## skip debug data product downlink


## perf reset			## Stop the structure program and reset
## perf runstr			## Begin Structure program

tcb mbsqreg 66 0		## not start in campaign
tcb mbsqreg  4 0		## not start in campaign
tcb mbsqreg  3 0		## start in IDLE telemetry
tcb mbsqreg  5 0                ## Clear MagHR Flag

tcb mbsqreg 65 1		## ALT enabled

tcb mbsqreg 53 3		## ALT repeats (DEP Reg)
tcb mbipldin 0x140 1349 3	## ALT repeats (IP Reg)

set !LI2 = 96 / !GI2
set !LI2 = !LI2 + 5		## MDM added 20-Nov-95 (since DEP definition changed)
tcb mbsqreg 54 !LI2		## ALT cadence (60?)

##tcb mbsqreg 67 0x0020		## Set Campaign address 
##tcb mbsqreg 67 0x00C0           ## Set Campaign address 
##tcb mbsqreg 73 0x0040           ## Set Chain List Address
tcb mbsqreg 67 22		## Set Campaign address 
tcb mbsqreg 73 88		## Set Chain List Address
tcb mbsqreg 68 0		## Clear new list flag
tcb mbsqreg 72 0		## Clear chain list flag

tcb mbsqreg 64 1		## Set new prime table flag

return

