# File: do_sum_diff_v01.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/do_sum_diff_v01.src"
descr "Loads IP queue instructions"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; NAME:    do_sum_diff.ips
#; PURPOSE: Add or difference two images and make the header
#; RESTRICTION:
#;	SCALESUM can only have the source/dest pages from 0-7 and 16-19
#; HISTORY: Written 29-Feb-96 by M.Morrison
#;
#;
#QSR_DO_SUM::
#    SETREG $IPRL_SUMDIFF_WORK+9 1
tcblock mbipcmd 0x0091 0x1994   0x0140 0x13B3 0x0001 
#    GOTO &COMMON_CODE
tcblock mbipcmd 0x0091 0x1997   0x0156 0x199C 
#
#QSR_DO_DIFF::
#    SETREG $IPRL_SUMDIFF_WORK+9 0xFFFF
tcblock mbipcmd 0x0091 0x1999   0x0140 0x13B3 0xFFFF 
#
#COMMON_CODE:
#;-------- Setup and do the calculation
#    COPYRD2D $IPRL_SUMDIFF_PARAM   $IPRL_SUMDIFF_WORK 6		;copy tw
tcblock mbipcmd 0x0091 0x199C   0x0144 0x13A0 0x13AA 0x0006 
#    COPYREG  $IPRL_SUMDIFF_PARAM+6 $IPRL_SUMDIFF_WORK+10	;copy th
tcblock mbipcmd 0x0091 0x19A0   0x0142 0x13A6 0x13B4 
#
#    _SCALESUM    $IPRL_SUMDIFF_WORK			
tcblock mbipcmd 0x0091 0x19A3   0x81E0 0x13AA 
#
#;-------- decode the source and destination page info
#    COPYREG  $IPRL_SUMDIFF_PARAM+1 $IPRL_HDECODE_PARAM		;copy the
tcblock mbipcmd 0x0091 0x19A5   0x0142 0x13A1 0x114A 
#    COPYREG  $IPRL_SUMDIFF_PARAM+5 $IPRL_HDECODE_PARAM+1	;copy th
tcblock mbipcmd 0x0091 0x19A8   0x0142 0x13A5 0x114B 
#    CALLQUE  $QSR_DO_HDECODE					;decode the value - 
tcblock mbipcmd 0x0091 0x19AB   0x01F8 0x1010 
#
#;-------- now copy the relevant info to the hrdinit slot and make
#    COPYRI2D $IPRP_HDECODE_ADDR+1     $IPRL_HEAD_WORK 10	;copy th
tcblock mbipcmd 0x0091 0x19AD   0x01AC 0x1152 0x1155 0x000A 
#    COPYRD2D $IPRL_SUMDIFF_PARAM+4    $IPRL_HEAD_WORK+6 4	;copy t
tcblock mbipcmd 0x0091 0x19B1   0x0144 0x13A4 0x115B 0x0004 
#    COPYRD2D $IPRL_SUMDIFF_PARAM+7    $IPRL_HEAD_WORK+3 3	;copy n
tcblock mbipcmd 0x0091 0x19B5   0x0144 0x13A7 0x1158 0x0003 
#    COPYRD2I $IPRL_HEAD_WORK          $IPRP_HDECODE_ADDR+1 10	;co
tcblock mbipcmd 0x0091 0x19B9   0x01AA 0x1155 0x1152 0x000A 
#
#    CALLQUE  $QSR_DO_HEADER
tcblock mbipcmd 0x0091 0x19BD   0x01F8 0x105F 
#    RTNQUE
tcblock mbipcmd 0x0091 0x19BF   0x01FA 
#
#
#
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
