<!--
	Assembler Encoding for the Add Mnemonic
	Version: 1.0.0
	Date Created:  2007-05-01
	Last Modified: 2007-05-18

	Designed for Pentium and higher x86 Processors in 32bit mode protected mode
	This DOES NOT set carry properly for future carry tests
	Optimized for Size

	Done list:
	o U/S8-256, Boolean added to U/S8-32, Boolean

	To Do:
	o Everything Else
-->
<encoding procfamily="x86" bitdepth="32" proc="Pentium">
	<!-- ############################################################################################################ -->
	<!-- ############################################################################################################ -->
	<!-- ############################################################################################################ -->
	<!-- Add Mnemonic -->
	<mnemonic name="Add" type="Assign" option="Size">
		<!-- ********************************************************************************************************** -->
		<!-- Adding TO 8bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->
		<codetypeset param0="U/S8" param1="U/S8-256">
			<codeset param0="M" param1="M" total="4" totalv="3"
				lostregs="al" endregs="al=@1.U8" endpipe="U">
				<line code="mov al, @1.U8" time="U 1" timev=" V1" comment="Get the value to add" />
				<line code="add @0.U8, al" time="U*3" timev="U 3" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="3" totalv="2" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 3" timev=" V3" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="I" total="3" endpipe="V">
				<line code="add @0.U8, @1.U8" time="&#45;&#45;3" comment="Add to the value (Assume it's not pairable)" />
			</codeset>

			<codeset param0="R" param1="M" total="2" totalv="1" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 2" timev=" V2" comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R,I" total="1" totalv="0" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 1" timev=" V1" comment="Add to the value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="U/S8" param1="Boolean">
			<codeset param0="M" param1="M" total="4" totalv="3"
				lostregs="al" endregs="al=@1.U8" endpipe="U">
				<line code="mov al, @1.U8" time="U 1" timev=" V1" comment="Get the value to add" />
				<line code="add @0.U8, al" time="U*3" timev="U 3" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="3" totalv="2" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 3" timev=" V3" comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="2" totalv="1" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 2" timev=" V2" comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R" total="1" totalv="0" endpipe="S">
				<line code="add @0.U8, @1.U8" time="U 1" timev=" V1" comment="Add to the value" />
			</codeset>
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- Adding TO 16bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8bit -->

		<!-- ====================================================================================== -->
		<!-- From U8 to U/S16 -->
		<codetypeset param0="U/S16" param1="U8">
			<codeset param0="M" param1="M,R" total="7"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U16, ax"  time="U 3+1"       comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="3" totalv="2" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 2" timev=" V2" comment="Add to the low byte of the value" />
				<line code="adc @0.U8[1], 0"  time="U!1"             comment="Add with carry to the high byte" />
			</codeset>
			<codeset param0="R" param1="R" total="2" totalv="1" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 1" timev=" V1" comment="Add to the low byte of the value" />
				<line code="adc @0.U8[1], 0"  time="U!1"             comment="Add with carry to the high byte" />
			</codeset>
		</codetypeset>


		<!-- ====================================================================================== -->
		<!-- From S8 to U/S16 -->
		<codetypeset param0="U/S16" param1="S8">
			<codeset param0="M" param1="M,R" total="7"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U16, ax"   time="U 3+1"       comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="4"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the full register value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 16-24bit -->
		<codetypeset param0="U/S16" param1="U/S16-24">
			<codeset param0="M" param1="M" total="6" totalv="5"
				lostregs="ax" endregs="@1.U16" endpipe="U">
				<line code="mov ax, @1.U16" time="U 1+1" timev=" V1+1" comment="Get the value to add" />
				<line code="add @0.U16, ax" time="U*3+1" timev="U 3+1" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="4" totalv="3" endpipe="S">
				<line code="add @0.U16, @1.U16" time="U 3+1" timev=" V3+1" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="I" total="4" endpipe="V">
				<line code="add @0.U16, @1.U16" time="&#45;&#45;3+1" comment="Add to the value (Assume it's not pairable)" />
			</codeset>

			<codeset param0="R" param1="M" total="3" totalv="2" endpipe="S">
				<line code="add @0.U16, @1.U16" time="U 2+1" timev=" V2+1" comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R,I" total="2" totalv="1" endpipe="S">
				<line code="add @0.U16, @1.U16" time="U 1+1" timev=" V1+1" comment="Add to the register value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 32-256bit -->
		<codetypeset param0="U/S16" param1="U/S32-256">
			<codeset param0="M" param1="M" total="5" totalv="4"
				lostregs="eax" endregs="eax=@1.U32" endpipe="U">
				<line code="mov eax, @1.U32" time="U 1"   timev=" V1"   comment="Get the value to add" />
				<line code="add @0.U16, ax"  time="U*3+1" timev="U 3+1" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="4" totalv="3" endpipe="S">
				<line code="add @0.U16, @1.U16" time="U 3+1" timev=" V3+1" comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="2" totalv="1" endpipe="S">
				<line code="add @0.U32, @1.U32" time="U 2" timev=" V2" comment="Add to the full register value" />
			</codeset>
			<codeset param0="R" param1="R" total="1" totalv="0" endpipe="S">
				<line code="add @0.U32, @1.U32" time="U 1" timev=" V1" comment="Add to the full register value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="U/S16" param1="Boolean">
			<codeset param0="M" param1="M,R" total="7"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U16, ax"   time="U 3+1"       comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="3" totalv="2" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 2" timev=" V2" comment="Add to the low byte of the value" />
				<line code="adc @0.U8, 0"     time="U!1"             comment="Add with carry to the high byte" />
			</codeset>
			<codeset param0="R" param1="R" total="2" totalv="1" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 1" timev=" V1" comment="Add to the low byte of the value" />
				<line code="adc @0.U8, 0"     time="U!1"             comment="Add with carry to the high byte" />
			</codeset>
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- Adding TO 24bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8bit -->

		<!-- ====================================================================================== -->
		<!-- From U8 to U/S24 -->
		<codetypeset param0="U/S24" param1="U8">
			<codeset param0="M" param1="M" total="10"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U16, ax"   time="U 3+1"       comment="Add to the low 16 bits of the value" />
				<line code="adc @0.U8[2], 0"  time="U!3"         comment="Add with carry to the high byte of the value" />
			</codeset>
			<codeset param0="M" param1="R" total="9" totalv="8" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 3" timev=" V3" comment="Add to the low byte of the value" />
				<line code="adc @0.U8[1], 0"  time="U!3"             comment="Add with carry to the middle byte of the value" />
				<line code="adc @0.U8[2], 0"  time="U!3"             comment="Add with carry to the high byte of the value" />
			</codeset>

			<codeset param0="R" param1="M,R" param0type="U24" total="5"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8"     time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"      time="U 1"         comment="Add to the value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"         comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M,R" param0type="S24" total="6"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
				<line code="shl @0.U32, 8"    time="U!1"         comment="Move it to the high byte" />
				<line code="sar @0.U32, 8"    time="U!1"         comment="SAR to sign extend" />
			</codeset>
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- From S8 to U/S24 -->
		<codetypeset param0="U/S24" param1="S8">
			<codeset param0="M" param1="M,R" total="10"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U16, ax"   time="U*3+1"       comment="Add to the low 16 bits of the value" />
				<line code="adc @0.U8[2], ah" time="U!3"         comment="Add with carry to the high byte of the value" />
			</codeset>

			<codeset param0="R" param1="M,R" param0type="U24" total="5"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8"     time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"      time="U 1"         comment="Add to the value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"         comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M,R" param0type="S24" total="6"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
				<line code="shl @0.U32, 8"    time="U!1"         comment="Move it to the high byte" />
				<line code="sar @0.U32, 8"    time="U!1"         comment="SAR to sign extend" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 16bit -->

		<!-- ====================================================================================== -->
		<!-- From U16 to U/S24 -->
		<codetypeset param0="U24" param1="U16">
			<codeset param0="M" param1="M" total="9" totalv="8"
				lostregs="ax" endregs="ax=@1.U16" endpipe="U">
				<line code="mov ax, @1.U16"  time="U 1+1" timev=" V1+1" comment="Get the value to add" />
				<line code="add @0.U16, ax"  time="U*3+1" timev="U 3+1" comment="Add to the low 16 bits" />
				<line code="adc @0.U8[2], 0" time="U!3"                 comment="Add with carry to the high byte" />
			</codeset>
			<codeset param0="M" param1="R" total="7" totalv="6" endpipe="U">
				<line code="add @0.U16, @1.U16" time="U 3+1" timev=" V3+1" comment="Add to the low 16 bits" />
				<line code="adc @0.U8[2], 0"    time="U!3"                 comment="Add with carry to the high byte" />
			</codeset>

			<codeset param0="R" param1="M" param0type="U24" total="5"
				lostregs="eax" endregs="eax=@1.U16" endpipe="U">
				<line code="movzx eax, @1.U16"    time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"      time="U 1"         comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"         comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M" param0type="S24" total="6"
				lostregs="eax" endregs="eax=@1.U16" endpipe="U">
				<line code="movzx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"   time="U 1"         comment="Add to the full register value" />
				<line code="shl @0.U32, 8"     time="U!1"         comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"     time="U!1"         comment="SAR to sign extend" />
			</codeset>
			<codeset param0="R" param1="R" param0type="U24" total="3" totalv="2" endpipe="U">
				<line code="and @1.U32, 0FFFFh"   time="U 1" timev=" V1" comment="Clear the high word on the value to add" />
				<line code="add @0.U32, @1.U32"   time="U*1" timev="U 1" comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"             comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="R" param0type="S24" total="4" totalv="3" endpipe="U">
				<line code="and @1.U32, 0FFFFh" time="U 1" timev=" V1" comment="Clear the high word on the value to add" />
				<line code="add @0.U32, @1.U32" time="U*1" timev="U 1" comment="Add to the full register value" />
				<line code="shl @0.U32, 8"      time="U!1"             comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"      time="U!1"             comment="SAR to sign extend" />
			</codeset>
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- From S16 to U/S24 -->
		<codetypeset param0="U/S24" param1="S16">
			<codeset param0="M" param1="M,R" total="3+?" totalv="2+?"
				lostregs="eax,edx" endregs="edx->@0.U8" endpipe="V">
				<line code="lea edx, @0.U8"               time="U 1"   timev=" V1"   comment="Point to our value" />
				<line code="mov ax, @1.U16"               time=" V1+1" timev="U 1+1" comment="Get the value to add" />
				<ilne code="call Mnemonic_Add_US24AndS16" time="!V1+?"               comment="Get our value" />
			</codeset>

			<codeset param0="R" param1="M" param0type="U24" total="5"
				lostregs="eax" endregs="eax=@1.S16" endpipe="U">
				<line code="movsx eax, @1.U16"    time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"      time="U 1"         comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"         comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M" param0type="S24" total="6"
				lostregs="eax" endregs="eax=@1.S16" endpipe="U">
				<line code="movsx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"   time="U 1"         comment="Add to the full register value" />
				<line code="shl @0.U32, 8"     time="U!1"         comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"     time="U!1"         comment="SAR to sign extend" />
			</codeset>
			<codeset param0="R" param1="R" param0type="U24" total="4" endpipe="U">
				<line code="shl @1.U32, 16"       time="U!1" comment="Shift the value to the top bytes" />
				<line code="sar @1.U32, 16"       time="U!1" comment="SAR to sign extend" />
				<line code="add @0.U32, @1.U32"   time="U*1" comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1" comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="R" param0type="S24" total="5" endpipe="U">
				<line code="shl @1.U32, 16"     time="U!1" comment="Shift the value to the top bytes" />
				<line code="sar @1.U32, 16"     time="U!1" comment="SAR to sign extend" />
				<line code="add @0.U32, @1.U32" time="U*1" comment="Add to the full register value" />
				<line code="shl @0.U32, 8"      time="U!1" comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"      time="U!1" comment="SAR to sign extend" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 24bit -->
		<codetypeset param0="U/S24" param1="U/S24">
			<codeset param0="M" param1="M" total="4+?" totalv="3+?"
				lostregs="eax,edx" endregs="edx->@0.U8" endpipe="V">
				<line code="mov ah, @1.U8[2]"                  time="U 1"   timev=" V1" comment="Get the high byte of the value to add" />
				<line code="shl eax, 8"                        time="U!1"               comment="Shift it into position" />
				<line code="lea edx, @0.U8"                    time=" V1"               comment="Point to our value" />
				<line code="mov ax, @1.U16"                    time="U 1+1"             comment="Get the low 16 bits of the value to add" />
				<line code="call Mnemonic_Add_US24AndUS24Plus" time="!V1+?"             comment="Add them together" />
			</codeset>
			<codeset param0="M" param1="R" total="2+?" totalv="1+?"
				lostregs="eax,edx" endregs="edx->@0.U8" endpipe="V">
				<line code="mov eax, @1.U32"                   time="U 1"   timev=" V1" comment="Get the full register value" />
				<line code="lea edx, @0.U8"                    time=" V1"   timev="U 1" comment="Point to our value" />
				<line code="call Mnemonic_Add_US24AndUS24Plus" time="!V1+?"             comment="Add them together" />
			</codeset>
			<codeset param0="M" param1="I" total="7" totalv="6" endpipe="U">
				<line code="add @0.U16, @1.U16"  time="U 3+1" timev=" V3+1" comment="Add the low 16 bits" />
				<line code="adc @0.U8[2], @1.U8" time="U*3"   timev="U 3"   comment="Add the high 8 bits" />
			</codeset>

			<codeset param0="R" param1="M" param0type="U24" total="6" totalv="5"
				lostregs="eax" endregs="ax=@1.U16" endpipe="U">
				<line code="mov ah, @1.U8[2]"     time="U 1"   timev=" V1" comment="Get the high byte" />
				<line code="shl eax, 8"           time="U!1"               comment="Shift it into position" />
				<line code="mov ax, @1.U16"       time="U*1+1"             comment="Get the low 16 bits" />
				<line code="add @0.U32, eax"      time="U*1"               comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"               comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M" param0type="S24" total="7" totalv="6"
				lostregs="eax" endregs="ax=@1.U16" endpipe="U">
				<line code="mov ah, @1.U8[2]" time="U 1"   timev=" V1" comment="Get the high byte" />
				<line code="shl eax, 8"       time="U!1"               comment="Shift it into position" />
				<line code="mov ax, @1.U16"   time="U*1+1"             comment="Get the low 16 bits" />
				<line code="add @0.U32, eax"  time="U*1"               comment="Add to the full register value" />
				<line code="shl @0.U32, 8"    time="U!1"               comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"    time="U!1"               comment="SAR to sign extend" />
			</codeset>
			<codeset param0="R" param1="R,I" param0type="U24" total="2" totalv="1" endpipe="U">
				<line code="add @0.U32, @1.U32"   time="U 1" timev=" V1" comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1" timev="U 1" comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="R,I" param0type="S24" total="3" totalv="2" endpipe="U">
				<line code="add @0.U32, @1.U32" time="U 1" timev=" V1" comment="Add to the full register value" />
				<line code="shl @0.U32, 8"      time="U!1"             comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"      time="U!1"             comment="SAR to sign extend" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 32-256bit -->
		<codetypeset param0="U/S24" param1="U/S32-256">
			<codeset param0="M" param1="M,R" total="2+?" totalv="1+?"
				lostregs="eax,edx" endregs="edx->@0.U8" endpipe="V">
				<line code="mov eax, @1.U32"                   time="U 1"   timev=" V1" comment="Get the full register value" />
				<line code="lea edx, @0.U8"                    time=" V1"   timev="U 1" comment="Point to our value" />
				<line code="call Mnemonic_Add_US24AndUS24Plus" time="!V1+?"             comment="Add them together" />
			</codeset>

			<codeset param0="R" param1="M" param0type="U24" total="3" totalv="2" endpipe="U">
				<line code="add @0.U32, @1.U32"   time="U 2" timev=" V2" comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1" timev="U 1" comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M" param0type="S24" total="4" totalv="3" endpipe="U">
				<line code="add @0.U32, @1.U32" time="U 2" timev=" V2" comment="Add to the full register value" />
				<line code="shl @0.U32, 8"      time="U!1"             comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"      time="U!1"             comment="SAR to sign extend" />
			</codeset>
			<codeset param0="R" param1="R" param0type="U24" total="2" totalv="1" endpipe="U">
				<line code="add @0.U32, @1.U32"   time="U 1" timev=" V1" comment="Add to the full register value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1" timev="U 1" comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="R" param0type="S24" total="3" totalv="2" endpipe="U">
				<line code="add @0.U32, @1.U32" time="U 1" timev=" V1" comment="Add to the full register value" />
				<line code="shl @0.U32, 8"      time="U!1"             comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"      time="U!1"             comment="SAR to sign extend" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="U/S24" param1="Boolean">
			<codeset param0="M" param1="M" total="10" totalv="9"
				lostregs="al" endregs="al=@1.U8" endpipe="U">
				<line code="mov al, @1.U8"   time="U 1" timev=" V1" comment="Get the value to add" />
				<line code="add @0.U8, al"   time="U*3" timev="U 3" comment="Add to the low byte of the value" />
				<line code="adc @0.U8[1], 0" time="U!3"             comment="Add with carry to the middle byte of the value" />
				<line code="adc @0.U8[2], 0" time="U!3"             comment="Add with carry to the high byte of the value" />
			</codeset>
			<codeset param0="M" param1="R" total="9" totalv="8" endpipe="U">
				<line code="add @0.U8, @1.U8" time="U 3" timev=" V3" comment="Add to the low byte of the value" />
				<line code="adc @0.U8[1], 0"  time="U!3"             comment="Add with carry to the middle byte of the value" />
				<line code="adc @0.U8[2], 0"  time="U!3"             comment="Add with carry to the high byte of the value" />
			</codeset>

			<codeset param0="R" param1="M,R" param0type="U24" total="5"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8"     time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"      time="U 1"         comment="Add to the value" />
				<line code="and @0.U32, 0FFFFFFh" time="U*1"         comment="Clear the high byte" />
			</codeset>
			<codeset param0="R" param1="M,R" param0type="S24" total="6"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
				<line code="shl @0.U32, 8"    time="U!1"         comment="Shift to the high byte" />
				<line code="sar @0.U32, 8"    time="U!1"         comment="SAR to sign extend" />
			</codeset>
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- Adding TO 32bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8bit -->

		<!-- ====================================================================================== -->
		<!-- From U8 to U/S32 -->
		<codetypeset param0="U/S32" param1="U8">
			<codeset param0="M" param1="M,R" total="6"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 3"         comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="4"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
			</codeset>
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- From S8 to U/S32 -->
		<codetypeset param0="U/S32" param1="S8">
			<codeset param0="M" param1="M,R" total="6"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 3"         comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="4"
				lostregs="eax" endregs="eax=@1.S8" endpipe="U">
				<line code="movsx eax, @1.U8" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 16bit -->

		<!-- ====================================================================================== -->
		<!-- From U16 to U/S32 -->
		<codetypeset param0="U/S32" param1="U16">
			<codeset param0="M" param1="M" total="6"
				lostregs="eax" endregs="eax=@1.U16" endpipe="U">
				<line code="movzx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"   time="U 3"         comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="4" totalv="3" endpipe="U">
				<line code="and @1.U32, 0FFFFh" time="U 1" timev=" V1" comment="Clear the high 16 bits" />
				<line code="add @0.U32, @1.U32" time="U*3" timev="U 3" comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="4"
				lostregs="eax" endregs="eax=@1.U16" endpipe="U">
				<line code="movzx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"   time="U 1"         comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R" total="2" totalv="1" endpipe="U">
				<line code="and @1.U32, 0FFFFh" time="U 1" timev=" V1" comment="Clear the high 16 bits" />
				<line code="add @0.U32, @1.U32" time="U*1" timev="U 1" comment="Add to the value" />
			</codeset>
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- From S16 to U/S32 -->
		<codetypeset param0="U/S32" param1="S16">
			<codeset param0="M" param1="M" total="6"
				lostregs="eax" endregs="eax=@1.S16" endpipe="U">
				<line code="movsx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax"   time="U 3"         comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="5" endpipe="U">
				<line code="shl @1.U16, 16"     time="U!1" comment="Shift it to the high 16 bits" />
				<line code="sar @1.U16, 16"     time="U!1" comment="SAR to sign extend" />
				<line code="add @0.U32, @1.U32" time="U*3" comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="4"
				lostregs="eax" endregs="eax=@1.S16" endpipe="U">
				<line code="movsx eax, @1.U16" time="&#45;&#45;3" comment="Get the value to add" />
				<line code="add @0.U32, eax "  time="U 1"         comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R" total="3" endpipe="U">
				<line code="shl @1.U16, 16"     time="U!1" comment="Shift it to the high 16 bits" />
				<line code="sar @1.U16, 16"     time="U!1" comment="SAR to sign extend" />
				<line code="add @0.U32, @1.U32" time="U*1" comment="Add to the value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 24bit -->
		<codetypeset param0="U/S32" param1="U/S24">
			<codeset param0="M" param1="M" param1type="U24" total="4+?" totalv="4+?"
				lostregs="eax,edx" endregs="eax=@1.U24,edx->@0.U8" endpipe="U">
				<line code="lea edx, @1.U8"       time="U 1"   timev=" V1" comment="Get a pointer to the value to add" />
				<line code="call General_ReadU24" time="!V1+?"             comment="Get the 24 bit value" />
				<line code="add @0.U32, eax"      time="U 3"               comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="M" param1type="S24" total="4+?" totalv="4+?"
				lostregs="eax,edx" endregs="eax=@1.S24,edx->@0.U8" endpipe="U">
				<line code="lea edx, @1.U8"       time="U 1"   timev=" V1" comment="Get a pointer to the value to add" />
				<line code="call General_ReadS24" time="!V1+?"             comment="Get the 24 bit value" />
				<line code="add @0.U32, eax"      time="U 3"               comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R" total="3" totalv="2" endpipe="S">
				<line code="add @0.U32, @1.U32"   time="U 3" timev=" V3" comment="Add the full register directly to the value" />
			</codeset>

			<codeset param0="R" param1="M" param1type="U24" total="2+?" totalv="2+?"
				lostregs="eax,edx" endregs="eax=@1.U24,edx->@0.U8" endpipe="U">
				<line code="lea edx, @1.U8"       time="U 1"   timev=" V1" comment="Get a pointer to the value to add" />
				<line code="call General_ReadU24" time="!V1+?"             comment="Get the 24 bit value" />
				<line code="add @0.U32, eax"      time="U 1"               comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="M" param1type="S24" total="2+?" totalv="2+?"
				lostregs="eax,edx" endregs="eax=@1.S24,edx->@0.U8" endpipe="U">
				<line code="lea edx, @1.U8"       time="U 1"   timev=" V1" comment="Get a pointer to the value to add" />
				<line code="call General_ReadS24" time="!V1+?"             comment="Get the 24 bit value" />
				<line code="add @0.U32, eax"      time="U 1"               comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R" total="1" totalv="0" endpipe="S">
				<line code="add @0.U32, @1.U32"   time="U 1" timev=" V1" comment="Add the full register directly to the value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 32-256bit -->
		<codetypeset param0="U/S32" param1="U/S32-256">
			<codeset param0="M" param1="M" total="4" totalv="3"
				lostregs="eax" endregs="eax=@1.U32" endpipe="U">
				<line code="mov eax, @1.U32" time="U 1" timev=" V1" comment="Get the value to add" />
				<line code="add @0.U32, eax" time="U*3" timev="U 3" comment="Add to the value" />
			</codeset>
			<codeset param0="M" param1="R,I" total="3" totalv="2" endpipe="S">
				<line code="add @0.U32, @1.U32" time="U 3" timev=" V3" comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M" total="2" totalv="1" endpipe="S">
				<line code="add @0.U32, @1.U32" time="U 2" timev=" V2" comment="Add to the value" />
			</codeset>
			<codeset param0="R" param1="R,I" total="1" totalv="0" endpipe="S">
				<line code="add @0.U32, @1.U32" time="U 1" timev=" V1" comment="Add to the value" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="U/S32" param1="Boolean">
			<codeset param0="M" param1="M,R" total="6"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value" />
				<line code="add @0.U32, eax"  time="U 3"         comment="Add to the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="4"
				lostregs="eax" endregs="eax=@1.U8" endpipe="U">
				<line code="movzx eax, @1.U8" time="&#45;&#45;3" comment="Get the value" />
				<line code="add @0.U32, eax"  time="U 1"         comment="Add to the value" />
			</codeset>
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- Adding TO Boolean -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->
		<codetypeset param0="Boolean" param1="U/S8-256">
			<codeset param0="M" param1="M,R" total="5" totalv="4"
				lostregs="al" endpipe="U">
				<line code="mov al, @1.U8" time="U 1" timev=" V1" comment="Get the low byte" />
				<line code="and al, 1"     time="U*1" timev="U 1" comment="Keep only the low bit" />
				<line code="xor @0.U8, al" time="U*3"             comment="Adding the bit is the same as XORing by it" />
			</codeset>
			<codeset param0="M" param1="V" total="4" totalv="3"
				lostregs="@1.U8" endpipe="U">
				<line code="and @1.U8, 1"     time="U 1" timev=" V1" comment="Keep only the low bit" />
				<line code="xor @0.U8, @1.U8" time="U*3" timev="U 3" comment="Adding the bit is the same as XORing by it" />
			</codeset>

			<codeset param0="R" param1="M,R" total="3" totalv="2"
				lostregs="al" endpipe="U">
				<line code="mov al, @1.U8" time="U 1" timev=" V1" comment="Get the low byte" />
				<line code="and al, 1"     time="U*1" timev="U 1" comment="Keep only the low bit" />
				<line code="xor @0.U8, al" time="U*1"             comment="Adding the bit is the same as XORing by it" />
			</codeset>
			<codeset param0="R" param1="V" total="2" totalv="1"
				lostregs="@1.U8" endpipe="U">
				<line code="and @1.U8, 1"     time="U 1" timev=" V1" comment="Keep only the low bit" />
				<line code="xor @0.U8, @1.U8" time="U*1" timev="U 1" comment="Adding the bit is the same as XORing by it" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="Boolean" param1="Boolean">
			<codeset param0="M" param1="M" total="4" totalv="3"
				lostregs="al" endregs="al=@1.U8" endpipe="U">
				<line code="mov al, @1.U8" time="U 1" timev=" V1" comment="Get the value to add" />
				<line code="xor @0.U8, al" time="U*3" timev="U 3" comment="XOR with the value" />
			</codeset>
			<codeset param0="M" param1="R,I" total="3" totalv="2" endpipe="S">
				<line code="xor @0.U8, @1.U8" time="U 3" timev=" V3" comment="XOR with the value" />
			</codeset>

			<codeset param0="R" param1="M" total="2" totalv="1" endpipe="U">
				<line code="xor @0.U8, @1.U8" time="U 2" timev=" V2" comment="XOR with the value" />
			</codeset>
			<codeset param0="R" param1="R,I" total="1" totalv="0" endpipe="S">
				<line code="xor @0.U8, @1.U8" time="U 1" timev=" V1" comment="XOR with the value" />
			</codeset>
		</codetypeset>
	</mnemonic>
</encoding>
