================
Opcode mnemonics
================

Immediately following the opcode in the HSF will be the arguments, if any, to that specific opcode. These are listed in the operands list of each opcode definition. In the documentation this list is formatted as a list of comma separated datatypes, in theHSF stream the opcodes and their operands are packed without any spaces or commas between them.

.. image:: hsf_buffer.gif

Some opcodes are expected to be used in ordered pairs, examples of these include ``TKE_Start_Compression``/``TKE_Stop_Compression`` and ``TKE_Start_User_Data``/``TKE_Stop_User_Data``. Not using these opcodes as ordered pairs will result in corrupt HSF streams.

Below is a table containingthe definitions of the different datatypes. Depending on the context datatypes can be signed or unsigned.

.. raw:: html

	<center>
	  <table BORDER =1 WIDTH="400">
		<TR> 
		  <TD height=21 width=131><FONT 
			face="Courier New,Courier,typewriter"><STRONG>Byte</STRONG></FONT></TD>
		  <TD height=21 width=390>Singlebyte of binary data. This 
			is often used for character strings.</FONT></TD>
		</TR>
		<TR> 
		  <TD height=21 width=131> <P><FONT 
			face="Courier New,Courier,typewriter"><STRONG>Short</STRONG></FONT><STRONG><FONT 
			face="Courier New,Courier,typewriter">/Word</FONT></STRONG></P></TD>
		  <TD height=21 width=390> short integer (two bytes) of binary memory, 
			stored in little-endian format.</FONT></TD>
		</TR>
		<TR> 
		  <TD height=21 width=131><FONT 
			face="Courier New,Courier,typewriter"><STRONG>Int/Long</STRONG></FONT></TD>
		  <TD height=21 width=390> integer (four bytes) of binary memory, stored 
			in little-endian format.</FONT></TD>
		</TR>
		<TR> 
		  <TD height=21 width=131><FONT 
			face="Courier New,Courier,typewriter"><STRONG>Float</STRONG></FONT></TD>
		  <TD height=21 width=390> Floating point value stored in little endian 
			format.</FONT></TD>
		</TR>
		<TR> 
		  <TD height=21 width=131><FONT 
			face="Courier New,Courier,typewriter"><STRONG>Point</STRONG></FONT></TD>
		  <TD height=21 width=390>An array of 3 floats.</TD>
		</TR>
		<tr> 
		  <td WIDTH="131" HEIGHT="21"><STRONG><FONT 
			face="Courier New,Courier,typewriter">Variable</FONT></STRONG></td>
		  <TD height=21 width=390>Miscellaneous formats, often used for bitmasks. 
			Specific details given for each usage in the appropriate opcode.<br>
			A common case is to read 1 byte, and if the appropriate bit is set, 
			one or more additional bytes specify additional more-significant bits. 
			Other usage includes different choices based on previous data.</TD>
		</tr>
	  </table>
	</center>


Arrays
======

Arrays are specified by ``(count)x`` in front of the base type. The count maybe an expression based on a previous operand value.


Optional fields
---------------

The presence of some data may be dependent on previous data elements. Square brackets ([ ]) will surround those data elements. The field and/or object description will indicate the dependency.
