# File: fmt_extract3_v01.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/fmt_extract3_v01.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#;
#;FILE:    fmt_extract3.ips
#;PURPOSE: To perform 3 extracts and make a header
#;METHOD:
#;	Inputs
#;		$IPRL_EXTRACT3_OFFSETS	- Holds    offset1(l,h), offset2(l,h), 
#;		$IPRL_EXTRACT3_PARAM	- Holds:   #pixels(l,h),n/k,dpc(h,l)
#;	Internal Use:
#;		$IPRL_EXTRACT3_OFFSET	- register which points to the register 
#;		$IPRL_HEAD_WORK		- a working copy of the header information
#;		$IPRL_EXTRACT3_INSTR	- the working area to build the instructi
#;					  source(l,h),dest(l,h),nx,ny,rowlength, global offset
#; HISTORY: Written 25-Apr-96 by M.Morrison
#
#QSR_FMT_EXTRACT3::
#
#        COPYREG  $IPRL_EXTRACT3_OFFSETS   R91			;Save the first l
tcblock mbipmacl 0x1931    0x0142 0x1442 0x005B 
#        COPYREG  $IPRL_EXTRACT3_OFFSETS+1 R92
tcblock mbipmacl 0x1934    0x0142 0x1443 0x005C 
#
#	;(do the header stuff before the extract because EXTRACT will ch
#
#	;--- do the decoding of the source/destination page
#	COPYREG  $IPRL_EXTRACT3_INSTR+1 $IPRL_HDECODE_PARAM	;copy the so
tcblock mbipmacl 0x1937    0x0142 0x1449 0x114A 
#	COPYREG  $IPRL_EXTRACT3_INSTR+3 $IPRL_HDECODE_PARAM+1	;copy the 
tcblock mbipmacl 0x193A    0x0142 0x144B 0x114B 
#
#	CALLQUE  $QSR_DO_HDECODE				;decode the value 
tcblock mbipmacl 0x193D    0x01F8 0x1010 
#
#	;--- now copy the relevant info to the hrdinit slot
#	COPYRI2D $IPRP_HDECODE_ADDR+1  $IPRL_HEAD_WORK 10	;copy the regi
tcblock mbipmacl 0x193F    0x01AC 0x1152 0x1155 0x000A 
#	COPYREG  $IPRL_EXTRACT3_INSTR+2  $IPRL_HEAD_WORK+6	;copy the fin
tcblock mbipmacl 0x1943    0x0142 0x144A 0x115B 
#	COPYREG  $IPRL_EXTRACT3_INSTR+3  $IPRL_HEAD_WORK+7	;copy the fin
tcblock mbipmacl 0x1946    0x0142 0x144B 0x115C 
#	COPYREG  $IPRL_EXTRACT3_PARAM+0  $IPRL_HEAD_WORK+8	;set the outp
tcblock mbipmacl 0x1949    0x0142 0x1450 0x115D 
#	COPYREG  $IPRL_EXTRACT3_PARAM+1  $IPRL_HEAD_WORK+9	;set the outp
tcblock mbipmacl 0x194C    0x0142 0x1451 0x115E 
#	COPYRD2D $IPRL_EXTRACT3_PARAM+2  $IPRL_HEAD_WORK+3 3	;n/k, dpc(h
tcblock mbipmacl 0x194F    0x0144 0x1452 0x1158 0x0003 
#	COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR+1 10	;copy the regis
tcblock mbipmacl 0x1953    0x01AA 0x1155 0x1152 0x000A 
#
#	CALLQUE  $QSR_DO_HEADER
tcblock mbipmacl 0x1957    0x01F8 0x105F 
#
#	COPYRD2D $IPRL_EXTRACT3_INSTR    $IPRL_FOCUS3_TMP_PAGE 3 ;save o
tcblock mbipmacl 0x1959    0x0144 0x1448 0x143F 0x0003 
#
#	SETREG	 $IPRL_EXTRACT3_INSTR+7  $IPRL_EXTRACT3_OFFSETS	;set the 
tcblock mbipmacl 0x195D    0x0140 0x144F 0x1442 
#	EXTRACT  $IPRL_EXTRACT3_INSTR				;do the extract
tcblock mbipmacl 0x1960    0x017A 0x1448 
#	COPYREG  $IPRL_FOCUS3_TMP_PAGE   $IPRL_EXTRACT3_INSTR	;restore s
tcblock mbipmacl 0x1962    0x0142 0x143F 0x1448 
#	COPYREG  $IPRL_FOCUS3_TMP_PAGE+1 $IPRL_EXTRACT3_INSTR+1	;restore
tcblock mbipmacl 0x1965    0x0142 0x1440 0x1449 
#
#	SETREG	 $IPRL_EXTRACT3_INSTR+7  $IPRL_EXTRACT3_OFFSETS+2
tcblock mbipmacl 0x1968    0x0140 0x144F 0x1444 
#	EXTRACT  $IPRL_EXTRACT3_INSTR				;do the extract
tcblock mbipmacl 0x196B    0x017A 0x1448 
#	COPYREG  $IPRL_FOCUS3_TMP_PAGE   $IPRL_EXTRACT3_INSTR	;restore s
tcblock mbipmacl 0x196D    0x0142 0x143F 0x1448 
#	COPYREG  $IPRL_FOCUS3_TMP_PAGE+1 $IPRL_EXTRACT3_INSTR+1	;restore
tcblock mbipmacl 0x1970    0x0142 0x1440 0x1449 
#
#	SETREG	 $IPRL_EXTRACT3_INSTR+7  $IPRL_EXTRACT3_OFFSETS+4
tcblock mbipmacl 0x1973    0x0140 0x144F 0x1446 
#	EXTRACT  $IPRL_EXTRACT3_INSTR				;do the extract
tcblock mbipmacl 0x1976    0x017A 0x1448 
#
#RTNQUE
tcblock mbipmacl 0x1978    0x01FA 
#=======================================================
#
return
#
#=======================================================
