# File: do_sum_diff_v02.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/do_sum_diff_v02.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#; 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 mbipmacl 0x1304    0x0140 0x13B3 0x0001 
#    GOTO &COMMON_CODE
tcblock mbipmacl 0x1307    0x0156 0x130C 
#
#QSR_DO_DIFF::
#    SETREG $IPRL_SUMDIFF_WORK+9 0xFFFF
tcblock mbipmacl 0x1309    0x0140 0x13B3 0xFFFF 
#
#COMMON_CODE:
#;-------- Setup and do the calculation
#    COPYRD2D $IPRL_SUMDIFF_PARAM   $IPRL_SUMDIFF_WORK 6		;copy tw
tcblock mbipmacl 0x130C    0x0144 0x13A0 0x13AA 0x0006 
#    COPYREG  $IPRL_SUMDIFF_PARAM+6 $IPRL_SUMDIFF_WORK+10	;copy th
tcblock mbipmacl 0x1310    0x0142 0x13A6 0x13B4 
#
#    _SCALESUM    $IPRL_SUMDIFF_WORK			
tcblock mbipmacl 0x1313    0x81E0 0x13AA 
#
#;-------- decode the source and destination page info
#    COPYREG  $IPRL_SUMDIFF_PARAM+1 $IPRL_HDECODE_PARAM		;copy the
tcblock mbipmacl 0x1315    0x0142 0x13A1 0x114A 
#    COPYREG  $IPRL_SUMDIFF_PARAM+5 $IPRL_HDECODE_PARAM+1	;copy th
tcblock mbipmacl 0x1318    0x0142 0x13A5 0x114B 
#    CALLQUE  $QSR_DO_HDECODE					;decode the value - 
tcblock mbipmacl 0x131B    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 mbipmacl 0x131D    0x01AC 0x1152 0x1155 0x000A 
#    COPYRD2D $IPRL_SUMDIFF_PARAM+4    $IPRL_HEAD_WORK+6 4	;copy t
tcblock mbipmacl 0x1321    0x0144 0x13A4 0x115B 0x0004 
#    COPYRD2D $IPRL_SUMDIFF_PARAM+7    $IPRL_HEAD_WORK+3 3	;copy n
tcblock mbipmacl 0x1325    0x0144 0x13A7 0x1158 0x0003 
#    COPYRD2I $IPRL_HEAD_WORK          $IPRP_HDECODE_ADDR+1 10	;co
tcblock mbipmacl 0x1329    0x01AA 0x1155 0x1152 0x000A 
#
#    CALLQUE  $QSR_DO_HEADER
tcblock mbipmacl 0x132D    0x01F8 0x105F 
#    RTNQUE
tcblock mbipmacl 0x132F    0x01FA 
#
#
#
#=======================================================
#
return
#
#=======================================================
