; ; FILE: do_sqrt_comp.ips ; RESTRICTION: ; The source page must be from 0-7 or 16-19 ; ; SQRT_COMP2 should not be used for anything except cropped data or ; else the format portion of the DPC will be wrong ; HISTORY: Written 29-Feb-96 by M.Morrison ; 5-Mar-96 (MDM) - Added restiction note on source page in the header ; 18-Jul-96 (MDM) - Expanded to do square-root capability to be ; able to use either of two tables ; 1-Aug-96 (MDM) - Removed second table capability ; - Added decrementing the K value by 1 ; ; QSR_SQRT_COMP:: SETREG $IPRL_SQRT_PARAM+7 9 ;which table to use SETREG $IPRL_SQRT_DPC_LOW 0x1000 ;add this value to the low word DPC ;;; GOTO &COMMON_CODE ;;;QSR_SQRT_COMP2:: ;;; SETREG $IPRL_SQRT_PARAM+7 6 ;which table to use ;;; SETREG $IPRL_SQRT_DPC_LOW 0xa000 ;add this value to the low word DPC COMMON_CODE: ;---- Read the header and find out how many points there are COPYREG $IPRL_SQRT_PARAM+1 $IPRL_HDECODE_PARAM ;copy the source page high word into a known fixed place COPYREG $IPRL_SQRT_PARAM+3 $IPRL_HDECODE_PARAM+1 ;copy the dest page high word into a known fixed place CALLQUE $QSR_DO_HDECODE ;decode the value COPYRI2D $IPRP_HDECODE_ADDR $IPRL_SQRT_OLDHEAD 10 ;copy the register list to a fixed working area COPYREG $IPRL_SQRT_OLDHEAD+8 $IPRL_SQRT_PARAM+4 ;copy # of pixels (l) COPYREG $IPRL_SQRT_OLDHEAD+9 $IPRL_SQRT_PARAM+5 ;copy # of pixels (h) _LOOKUP $IPRL_SQRT_PARAM ;-------- now copy the relevant info to the hrdinit slot and make the header COPYRI2D $IPRP_HDECODE_ADDR+1 $IPRL_HEAD_WORK 10 ;copy the register list to a fixed working area COPYREG $IPRL_SQRT_PARAM+2 $IPRL_HEAD_WORK+6 ;copy the final dest(l) COPYREG $IPRL_SQRT_PARAM+3 $IPRL_HEAD_WORK+7 ;copy the final dest(h) COPYRD2D $IPRL_SQRT_OLDHEAD+3 $IPRL_HEAD_WORK+3 3 ;copy n/k, dpc(l), and dpc(h) into the HRDINIT slot REGADD $IPRL_HEAD_WORK+5 $IPRL_SQRT_DPC_LOW $IPRL_HEAD_WORK+5 ;indicate that the dataproduct is square rooted ;;ADDREGD $IPRL_HEAD_WORK+5 0x1000 ;indicate that the dataproduct is square rooted ADDREGD $IPRL_HEAD_WORK+3 -1 ;decrement the k value by one COPYREG $IPRL_SQRT_OLDHEAD+8 $IPRL_HEAD_WORK+8 ;set the output number of pixels (l) COPYREG $IPRL_SQRT_OLDHEAD+9 $IPRL_HEAD_WORK+9 ;set the output number of pixels (h) COPYRD2I $IPRL_HEAD_WORK $IPRP_HDECODE_ADDR+1 10 ;copy the register list back to the slot CALLQUE $QSR_DO_HEADER RTNQUE