; ;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), offset3(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 holding the offset ; $IPRL_HEAD_WORK - a working copy of the header information ; $IPRL_EXTRACT3_INSTR - the working area to build the instruction ; 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 lower-left extract corner for data product header COPYREG $IPRL_EXTRACT3_OFFSETS+1 R92 ;(do the header stuff before the extract because EXTRACT will change the addresses) ;--- do the decoding of the source/destination page COPYREG $IPRL_EXTRACT3_INSTR+1 $IPRL_HDECODE_PARAM ;copy the source page high word into a known fixed parameter place COPYREG $IPRL_EXTRACT3_INSTR+3 $IPRL_HDECODE_PARAM+1 ;copy the dest page high word into a known fixed parameter place CALLQUE $QSR_DO_HDECODE ;decode the value ;--- now copy the relevant info to the hrdinit slot COPYRI2D $IPRP_HDECODE_ADDR+1 $IPRL_HEAD_WORK 10 ;copy the register list to a fixed working area COPYREG $IPRL_EXTRACT3_INSTR+2 $IPRL_HEAD_WORK+6 ;copy the final dest(l) COPYREG $IPRL_EXTRACT3_INSTR+3 $IPRL_HEAD_WORK+7 ;copy the final dest(h) COPYREG $IPRL_EXTRACT3_PARAM+0 $IPRL_HEAD_WORK+8 ;set the output number of pixels (l) COPYREG $IPRL_EXTRACT3_PARAM+1 $IPRL_HEAD_WORK+9 ;set the output number of pixels (h) COPYRD2D $IPRL_EXTRACT3_PARAM+2 $IPRL_HEAD_WORK+3 3 ;n/k, dpc(h,l) COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR+1 10 ;copy the register list back to the slot CALLQUE $QSR_DO_HEADER COPYRD2D $IPRL_EXTRACT3_INSTR $IPRL_FOCUS3_TMP_PAGE 3 ;save original source page SETREG $IPRL_EXTRACT3_INSTR+7 $IPRL_EXTRACT3_OFFSETS ;set the extract instr offset reg to off#1 EXTRACT $IPRL_EXTRACT3_INSTR ;do the extract COPYREG $IPRL_FOCUS3_TMP_PAGE $IPRL_EXTRACT3_INSTR ;restore source(l) COPYREG $IPRL_FOCUS3_TMP_PAGE+1 $IPRL_EXTRACT3_INSTR+1 ;restore source(h) SETREG $IPRL_EXTRACT3_INSTR+7 $IPRL_EXTRACT3_OFFSETS+2 EXTRACT $IPRL_EXTRACT3_INSTR ;do the extract COPYREG $IPRL_FOCUS3_TMP_PAGE $IPRL_EXTRACT3_INSTR ;restore source(l) COPYREG $IPRL_FOCUS3_TMP_PAGE+1 $IPRL_EXTRACT3_INSTR+1 ;restore source(h) SETREG $IPRL_EXTRACT3_INSTR+7 $IPRL_EXTRACT3_OFFSETS+4 EXTRACT $IPRL_EXTRACT3_INSTR ;do the extract RTNQUE