; ; FILE: do_hdecode_v03.ips ; PURPOSE: Given the high word of the source and desination pages, figure out which HRDINIT slot to use for the header stuff ; The routine also copies the source page info of "n/k, dpc(l,h)" into the destination page slot ; METHOD: ; Input: $IPRL_HDECODE_PARAM - holds the source high word to be decoded ; $IPRL_HDECODE_PARAM+1 - holds the destination high word to be decoded ; $IPRP_HDECODE_PAGE* - The start of the header table area (10 words per header entry) ; Output: $IPRP_HDECODE_ADDR - holds the pointer to the header paramters to use (one set for source, one for dest) ; Internal: $IPRP_HDECODE_WORK - temp holding area ; RESTRICTON: ; After the 3-Nov-95 modification, all of the IPRP_HDECODE_PAGE* lables must be consecutive in register space ; HISTORY: Written 14-Aug-95 by M.Morrison ; 30-Aug-95 (MDM) - Changed the name and allowed either of the ; - changed considerably (loop and do source and dest page with a single call) ; - also copy the n/k, dpc(l,h) from source to dest slots ; 5-Sep-95 (MDM) - Added some page entries ; 6-Sep-95 (MDM) - Fixed typo ; 3-Nov-95 (MDM) - Modified to work by looking through the contents of the lists ; rather than having a ton of "case" statements. ; QSR_DO_HDECODE:: SETREG $IPRL_HDECODE_LOOP 0 COPYREG $IPRL_HDECODE_PARAM $IPRL_HDECODE_PWORK ;copy the first address to temp working area HDECODE_LOOP: SETREG $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE0 ;currently seeing if that list matches (high word) COPYRI2D $IPRP_HDECODE_WORK $IPRL_HDECODE_WORK3 3 ;copy the first 3 words into a working area COPYREG $IPRP_HDECODE_ADDR+1 $IPRP_HDECODE_ADDR ;cheap way to copy the answer from the first time through ;the loop into the first address location (source) NEXT_ITEM: REGSUB $IPRL_HDECODE_WORK3+1 $IPRL_HDECODE_PWORK $IPRL_HDECODE_COMP ;compare input addr with addr in list BRANCHEQ $IPRL_HDECODE_COMP 0 &FOUND_ITEM ADDREGD $IPRP_HDECODE_WORK 10 ;Move forward to next list of 10 COPYRI2D $IPRP_HDECODE_WORK $IPRL_HDECODE_WORK3 3 ;copy the first 3 words into a working area BRANCHNE $IPRL_HDECODE_WORK3+1 0xFFFF &NEXT_ITEM FOUND_ITEM: COPYREG $IPRP_HDECODE_WORK $IPRP_HDECODE_ADDR+1 ;destination (or source) was decoded - save it ;if it was the source (first run through the loop) it is ;copied to the +0 location up above. COPYREG $IPRL_HDECODE_PARAM+1 $IPRL_HDECODE_PWORK ;copy the second address to temp working area ADDREGD $IPRL_HDECODE_LOOP 1 BRANCHEQ $IPRL_HDECODE_LOOP 1 &HDECODE_LOOP ;go through the loop twice HDECODE_STEP3: ;----- copy the n/k, dpc(l,h) from the source page to the destination page slots COPYRD2D $IPRP_HDECODE_ADDR $IPRP_ADD_ADDR 3 ;copy the source/dest pointer values to a fixed place (copies extra word) ADDREGD $IPRP_ADD_ADDR 3 ;increment forward to the n/k position of source slot ADDREGD $IPRP_ADD_ADDR+1 3 ;increment forward to the n/k position of destination slot COPYRI2I $IPRP_ADD_ADDR $IPRP_ADD_ADDR+1 3 ;copy the n/k, dpc(l,h) from source to dest slots RTNQUE