# File: do_header_v01.src
#
program "%Z% MODULE: %M% RELEASE: %R%.%L% CREATED: %G% %U%"
source "do_header_v01.ips"
descr "Loads IP queue instructions"
#
# DSBQUE                ; Disable Queue
tcblock mbipldin 0x0154 
#
#=======================================================
#
#
#; FILE:    DO_HEADER
#; PURPOSE: To make the header and to copy it to the proper locati
#; METHOD:  
#;	The header is always made to a fixed location (page 11) and the
#;	to the final desination.  The routine HDECODE is called before 
#;	The header is constructed using the DESINATION slot information
#;	the source page (for the camera header) is from the SOURCE page
#;
#;	Inputs:
#;		$IPRP_HDECODE_ADDR	- holds the pointers to the source and dest
#;	Outputs/Modifies:
#;		(none?)
#;	Internal Use:
#;		$IPRL_HEAD_WORK		- used by the HRDINIT instruction
#;		$IPRL_HEAD_COPY		- used to copy the header to the proper locat
#; HISTORY: Written 14-Aug-95 by M.Morrison
#;          30-Aug-95 (MDM) - Changed the name
#;	    5-Sep-95 (MDM) - Modified to do 4 byte math when backing th
#;	    6-Sep-95 (MDM) - Fixed the source address to back up to sta
#;	   18-Sep-95 (MDM) - Fixed to use _MOVBLKI instead of MOVBLK
#;	   17-Oct-95 (MDM) - Patched to use the source page for the HRD
#;			     to get the camera header properly.
#;          16-Nov-95 (MDM) - Removed all debug statements
#;
#QSR_DO_HEADER::
#
#	COPYRI2D $IPRP_HDECODE_ADDR+1 $IPRL_HEAD_WORK 10 ;copy the heade
tcblock mbipcmd 0x0091 0x105F   0x01AC 0x1152 0x1155 0x000A 
#	COPYRI2D $IPRP_HDECODE_ADDR   $IPRL_HEAD_WORK  3 ;copy the sourc
tcblock mbipcmd 0x0091 0x1063   0x01AC 0x1151 0x1155 0x0003 
#	;;ADDADR   $IPRL_HEAD_WORK $IPRL_NEG_549W $IPRL_HEAD_WORK	;shift
#	REGADD   $IPRL_HEAD_WORK $IPRL_NEG_549W $IPRL_HEAD_WORK		;shift 
tcblock mbipcmd 0x0091 0x1067   0x0146 0x1155 0x1169 0x1155 
#	HRDINIT  $IPRL_HEAD_WORK			;destination is always to a fixed pla
tcblock mbipcmd 0x0091 0x106B   0x019C 0x1155 
#
#
#							;first 2 words of $IPRL_HEAD_COPY are fixed as "10:0x0000"
#	COPYRD2D $IPRL_HEAD_WORK+6 $IPRL_HEAD_COPY+2 3	;copy final dest 
tcblock mbipcmd 0x0091 0x106D   0x0144 0x115B 0x1161 0x0003 
#	;;ADDADR   $IPRL_HEAD_COPY+2 $IPRL_NEG_550W $IPRL_HEAD_COPY+2	;s
#	;TODO!!!! Fix the math to work with 32 bits
#	REGADD   $IPRL_HEAD_COPY+2 $IPRL_NEG_550W $IPRL_HEAD_COPY+2	;shi
tcblock mbipcmd 0x0091 0x1071   0x0146 0x1161 0x1167 0x1161 
#	SETREG   $IPRL_HEAD_COPY+4 0x0226		;set the low word for number 
tcblock mbipcmd 0x0091 0x1075   0x0140 0x1163 0x0226 
#
#
#	_MOVBLKI  $IPRL_HEAD_COPY			;copy the constructed header to it's
tcblock mbipcmd 0x0091 0x1078   0x8166 0x115F 
#
#
#	RTNQUE
tcblock mbipcmd 0x0091 0x107A   0x01FA 
#=======================================================
#
# ENBQUE                ; Enable Queue
tcblock mbipldin 0x0136
#
#
return
#
#=======================================================
