# File: do_hdecode.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "do_hdecode.ips"
descr "do_hdecode - (WTF)"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#;
#; 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: $IPRL_HDECODE_WORK    - temp holding area
#; 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
#;
#QSR_DO_HDECODE::
#    SETREG   $IPRL_HDECODE_LOOP 0
tcblock mbipcmd 0x0091 0x1068   0x0140 0x10CE 0x0000 
#    COPYREG  $IPRL_HDECODE_PARAM $IPRL_HDECODE_PWORK		;copy the f
tcblock mbipcmd 0x0091 0x106B   0x0142 0x10C8 0x10CA 
#
#HDECODE_LOOP:
#    COPYREG  $IPRP_HDECODE_ADDR+1 $IPRP_HDECODE_ADDR       	;chea
tcblock mbipcmd 0x0091 0x106E   0x0142 0x10CD 0x10CC 
#								;the loop into the first address location (source)
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE0             ;
tcblock mbipcmd 0x0091 0x1071   0x0140 0x10CB 0x1000 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x0000 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x1074   0x01AE 0x10CA 0x0000 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE1
tcblock mbipcmd 0x0091 0x1078   0x0140 0x10CB 0x100A 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x0800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x107B   0x01AE 0x10CA 0x0800 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE2
tcblock mbipcmd 0x0091 0x107F   0x0140 0x10CB 0x1014 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x1000 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x1082   0x01AE 0x10CA 0x1000 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE3
tcblock mbipcmd 0x0091 0x1086   0x0140 0x10CB 0x101E 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x1800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x1089   0x01AE 0x10CA 0x1800 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE4
tcblock mbipcmd 0x0091 0x108D   0x0140 0x10CB 0x1028 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x2000 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x1090   0x01AE 0x10CA 0x2000 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE5
tcblock mbipcmd 0x0091 0x1094   0x0140 0x10CB 0x1032 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x2800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x1097   0x01AE 0x10CA 0x2800 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE6
tcblock mbipcmd 0x0091 0x109B   0x0140 0x10CB 0x103C 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x3000 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x109E   0x01AE 0x10CA 0x3000 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE7
tcblock mbipcmd 0x0091 0x10A2   0x0140 0x10CB 0x1046 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x3800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10A5   0x01AE 0x10CA 0x3800 0x10E1 
#
#;... fill in all possible cases that we will be using
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE11
tcblock mbipcmd 0x0091 0x10A9   0x0140 0x10CB 0x1050 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x5800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10AC   0x01AE 0x10CA 0x5800 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE11B
tcblock mbipcmd 0x0091 0x10B0   0x0140 0x10CB 0x105A 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x5804 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10B3   0x01AE 0x10CA 0x5804 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE11C
tcblock mbipcmd 0x0091 0x10B7   0x0140 0x10CB 0x1064 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x5808 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10BA   0x01AE 0x10CA 0x5808 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE11D
tcblock mbipcmd 0x0091 0x10BE   0x0140 0x10CB 0x106E 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x580C &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10C1   0x01AE 0x10CA 0x580C 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE15
tcblock mbipcmd 0x0091 0x10C5   0x0140 0x10CB 0x1082 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x7800 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10C8   0x01AE 0x10CA 0x7800 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE15B
tcblock mbipcmd 0x0091 0x10CC   0x0140 0x10CB 0x108C 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x7804 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10CF   0x01AE 0x10CA 0x7804 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE15C
tcblock mbipcmd 0x0091 0x10D3   0x0140 0x10CB 0x1096 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x7808 &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10D6   0x01AE 0x10CA 0x7808 0x10E1 
#
#    SETREG   $IPRP_HDECODE_WORK $IPRP_HDECODE_PAGE15D
tcblock mbipcmd 0x0091 0x10DA   0x0140 0x10CB 0x10A0 
#    BRANCHEQ $IPRL_HDECODE_PWORK 0x780C &HDECODE_STEP2          ;
tcblock mbipcmd 0x0091 0x10DD   0x01AE 0x10CA 0x780C 0x10E1 
#
#
#HDECODE_STEP2:
#    COPYREG  $IPRP_HDECODE_WORK $IPRP_HDECODE_ADDR+1       	;dest
tcblock mbipcmd 0x0091 0x10E1   0x0142 0x10CB 0x10CD 
#								;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 mbipcmd 0x0091 0x10E4   0x0142 0x10C9 0x10CA 
#    ADDREGD  $IPRL_HDECODE_LOOP 1
tcblock mbipcmd 0x0091 0x10E7   0x01BC 0x10CE 0x0001 
#    BRANCHEQ $IPRL_HDECODE_LOOP 1 &HDECODE_LOOP			;go through the
tcblock mbipcmd 0x0091 0x10EA   0x01AE 0x10CE 0x0001 0x106E 
#
#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 mbipcmd 0x0091 0x10EE   0x0144 0x10CC 0x1137 0x0003 
#    ADDREGD  $IPRP_ADD_ADDR 3					;increment forward to the n/k p
tcblock mbipcmd 0x0091 0x10F2   0x01BC 0x1137 0x0003 
#    ADDREGD  $IPRP_ADD_ADDR+1 3					;increment forward to the n/k
tcblock mbipcmd 0x0091 0x10F5   0x01BC 0x1138 0x0003 
#    COPYRI2I $IPRP_ADD_ADDR $IPRP_ADD_ADDR+1 3			;copy the n/k, d
tcblock mbipcmd 0x0091 0x10F8   0x01A8 0x1137 0x1138 0x0003 
#
#    RTNQUE
tcblock mbipcmd 0x0091 0x10FC   0x01FA 
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
