# File: do_hdecode_v04.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/flight/src/do_hdecode_v04.src"
descr "Loads IP queue instructions"
#=======================================================
#
#
#;
#; FILE:    do_hdecode.ips
#; PURPOSE: Given the high word of the source and desination pages
#;	   The routine also copies the source page info of "n/k, dpc(l,
#; METHOD:
#;       Input:  $IPRL_HDECODE_PARAM     - holds the source high w
#;		$IPRL_HDECODE_PARAM+1	- holds the destination high word to be 
#;               $IPRP_HDECODE_PAGE*     - The start of the header
#;       Output: $IPRP_HDECODE_ADDR      - holds the pointer to th
#;       Internal: $IPRP_HDECODE_WORK    - temp holding area
#; RESTRICTON:
#;	After the 3-Nov-95 modification, all of the IPRP_HDECODE_PAGE* 
#; HISTORY: Written 14-Aug-95 by M.Morrison
#;          30-Aug-95 (MDM) - Changed the name and allowed either 
#;			   - changed considerably (loop and do source and dest page w
#;			   - 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 co
#;			     rather than having a ton of "case" statements.
#;
#QSR_DO_HDECODE::
#    SETREG   $IPRL_HDECODE_LOOP 0
tcblock mbipmacl 0x1010    0x0140 0x1153 0x0000 
#    COPYREG  $IPRL_HDECODE_PARAM $IPRL_HDECODE_PWORK		;copy the f
tcblock mbipmacl 0x1013    0x0142 0x114A 0x114C 
#
#HDECODE_LOOP:
#    SETREG   $IPRP_HDECODE_WORK  $IPRP_HDECODE_PAGE0		;currently 
tcblock mbipmacl 0x1016    0x0140 0x114D 0x1000 
#    COPYRI2D $IPRP_HDECODE_WORK  $IPRL_HDECODE_WORK3 3		;copy the
tcblock mbipmacl 0x1019    0x01AC 0x114D 0x114E 0x0003 
#
#    COPYREG  $IPRP_HDECODE_ADDR+1 $IPRP_HDECODE_ADDR       	;chea
tcblock mbipmacl 0x101D    0x0142 0x1152 0x1151 
#								;the loop into the first address location (source)
#
#
#NEXT_ITEM:
#     REGSUB   $IPRL_HDECODE_WORK3+1 $IPRL_HDECODE_PWORK $IPRL_HDE
tcblock mbipmacl 0x1020    0x2146 0x114F 0x114C 0x1154 
#     BRANCHEQ $IPRL_HDECODE_COMP 0 &FOUND_ITEM
tcblock mbipmacl 0x1024    0x01AE 0x1154 0x0000 0x1033 
#
#     ADDREGD  $IPRP_HDECODE_WORK 10				;Move forward to next list
tcblock mbipmacl 0x1028    0x01BC 0x114D 0x000A 
#     COPYRI2D $IPRP_HDECODE_WORK $IPRL_HDECODE_WORK3 3		;copy the
tcblock mbipmacl 0x102B    0x01AC 0x114D 0x114E 0x0003 
#     BRANCHNE $IPRL_HDECODE_WORK3+1 0xFFFF &NEXT_ITEM
tcblock mbipmacl 0x102F    0x01B0 0x114F 0xFFFF 0x1020 
#FOUND_ITEM:
#
#    COPYREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_ADDR+1       	;des
tcblock mbipmacl 0x1033    0x0142 0x114D 0x1152 
#								;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
tcblock mbipmacl 0x1036    0x0142 0x114B 0x114C 
#    ADDREGD  $IPRL_HDECODE_LOOP 1
tcblock mbipmacl 0x1039    0x01BC 0x1153 0x0001 
#    BRANCHEQ $IPRL_HDECODE_LOOP 1 &HDECODE_LOOP			;go through the
tcblock mbipmacl 0x103C    0x01AE 0x1153 0x0001 0x1016 
#
#HDECODE_STEP3:
#    ;----- copy the n/k, dpc(l,h) from the source page to the des
#
#    COPYRD2D $IPRP_HDECODE_ADDR $IPRP_ADD_ADDR 3		;copy the sourc
tcblock mbipmacl 0x1040    0x0144 0x1151 0x11CD 0x0003 
#    ADDREGD  $IPRP_ADD_ADDR 3					;increment forward to the n/k p
tcblock mbipmacl 0x1044    0x01BC 0x11CD 0x0003 
#    ADDREGD  $IPRP_ADD_ADDR+1 3					;increment forward to the n/k
tcblock mbipmacl 0x1047    0x01BC 0x11CE 0x0003 
#    COPYRI2I $IPRP_ADD_ADDR $IPRP_ADD_ADDR+1 3			;copy the n/k, d
tcblock mbipmacl 0x104A    0x01A8 0x11CD 0x11CE 0x0003 
#
#    RTNQUE
tcblock mbipmacl 0x104E    0x01FA 
#=======================================================
#
return
#
#=======================================================
