<!--
	Assembler Encoding for the ShiftRight Mnemonic
	Version: 1.0.0
	Date Created:  2007-05-13
	Last Modified: 2007-09-29

	Designed for Pentium and higher x86 Processors in 32bit mode protected mode
	Optimized for Size

	Notes:
	o Shifting by anything that is larger than 8bits will only use the lower 8bits.
		We may decide to clear to zero if any value is larger than 256, which would significantly slow this operation
		down, OR we can decide to live with this "limitation"
	o Shifting by oversized values (such as 32 or higher) DOES NOT work. The x86 processor stupidly does a & 31 on all
	  rotation values, making it impossible to have them work properly (ie, clear to zero).
	  We may add clear to zero testing, which would require branching !! but would fix this problem... it'd also
	  significantly slow this operation down
	o Shifting an unsigned value uses logical shifting (the high bit becomes 0)
	o Shifting a signed value uses arithmetic shifting (the high bit is preserved)

	Done list:
	o U/S8-256,Boolean to U/S8-32,Boolean

	To Do:
	o U/S8-256,Boolean to U/S48-256
-->
<encoding procfamily="x86" bitdepth="32" proc="Pentium">
	<!-- ############################################################################################################ -->
	<!-- ############################################################################################################ -->
	<!-- ############################################################################################################ -->
	<!-- ShiftRight Mnemonic -->
	<mnemonic name="ShiftRight" type="Assign" option="Size">
		<!-- ********************************************************************************************************** -->
		<!-- ShiftRighting 8bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U8" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="6" totalv="6" id="SHRUS8-256ToU8_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"    time="U 1" timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="shr @0.U8, cl" time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"    time="U 1"             comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="3" endpipe="V">
				<line code="shr @0.U8, @1.U8" time="&#45;&#45;3" comment="Shift right (assume not pipable)" />
			</codeset>
			<codeset param0="R.U8=cl" param1="M,R" total="6" totalv="6" id="SHRUS8-256ToU8_Rcl_MR"
				lostregs="al" endregs="al=@0.U8" endpipe="U">
				<line code="mov al, cl"    time="U 1" timev=" V1" comment="Move CL to AL" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="shr al, cl"    time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"    time="U 1"             comment="Store the result" />
			</codeset>
			<codeset param0="M,R" param1="R.U8=cl" total="4" id="SHRUS8-256ToU8_MR_Rcl" endpipe="V">
				<line code="shr @0.U8, cl" time="&#45;&#45;4" comment="Shift right" />
			</codeset>

			<codeset param0="R" param1="I" total="1" endpipe="U">
				<line code="shr @0.U8, @1.U8" time="U!1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- Signed/Arithmetic Shift Right -->
		<codetypeset param0="S8" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="6" totalv="6" id="SARUS8-256ToS8_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"    time="U 1" timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="sar @0.U8, cl" time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"    time="U 1"             comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="3" endpipe="V">
				<line code="sar @0.U8, @1.U8" time="&#45;&#45;3" comment="Shift right (assume not pipable)" />
			</codeset>
			<codeset param0="R.U8=cl" param1="M,R" total="6" totalv="6" id="SARUS8-256ToS8_Rcl_MR"
				lostregs="al" endregs="al=@0.U8" endpipe="U">
				<line code="mov al, cl"    time="U 1" timev=" V1" comment="Move CL to AL" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="sar al, cl"    time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"    time="U 1"             comment="Store the result" />
			</codeset>
			<codeset param0="M,R" param1="R.U8=cl" total="4" id="SARUS8-256ToS8_MR_Rcl" endpipe="V">
				<line code="sar @0.U8, cl" time="&#45;&#45;4" comment="Shift right" />
			</codeset>

			<codeset param0="R" param1="I" total="1" endpipe="U">
				<line code="sar @0.U8, @1.U8" time="U!1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U8" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SHRUS8-256ToU8_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SHRUS8-256ToU8_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SHRUS8-256ToU8_MR_Rcl" />
		</codetypeset>

		<!-- ====================================================================================== -->
		<!-- Signed/Arithmetic Shift Right -->
		<codetypeset param0="S8" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SARUS8-256ToS8_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SARUS8-256ToS8_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SARUS8-256ToS8_MR_Rcl" />
		</codetypeset>


		<!-- ********************************************************************************************************** -->
		<!-- ShiftRighting 16bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U16" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="7" totalv="7" id="SHRUS8-256ToU16_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"     time="U 1"   timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8"  time=" V1"   timev="U 1" comment="Get the value to shift by" />
				<line code="shr @0.U16, cl" time="&#45;&#45;4+1"     comment="Shift right" />
				<line code="mov cl, al"     time="U 1"               comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="4" endpipe="V">
				<line code="shr @0.U16, @1.U8" time="&#45;&#45;3+1" comment="Shift right (assume not pipable)" />
			</codeset>

			<codeset param0="R.U8=cl" param1="M,R" total="7" totalv="7" id="SHRUS8-256ToU16_MR_Rcl"
				lostregs="eax" endregs="eax=@0.U32" endpipe="U">
				<line code="mov eax, ecx"  time="U 1" timev=" V1" comment="Move ECX to EAX" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="shr ax, cl"    time="&#45;&#45;4+1"   comment="Shift right" />
				<line code="mov ecx, eax"  time="U 1"             comment="Store it" />
			</codeset>
			<codeset param0="R" param1="I" total="2" totalv="2" endpipe="U">
				<line code="shr @0.U16, @1.U8" time="U!1+1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="R.U8=cl" total="5" id="SHRUS8-256ToU16_Rcl_MR" endpipe="V">
				<line code="shr @0.U16, cl" time="&#45;&#45;4+1" comment="Shift right" />
			</codeset>
			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>

		<codetypeset param0="S16" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="7" totalv="7" id="SARUS8-256ToS16_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"     time="U 1"   timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8"  time=" V1"   timev="U 1" comment="Get the value to shift by" />
				<line code="sar @0.U16, cl" time="&#45;&#45;4+1"     comment="Shift right" />
				<line code="mov cl, al"     time="U 1"               comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="4" endpipe="V">
				<line code="sar @0.U16, @1.U8" time="&#45;&#45;3+1" comment="Shift right (assume not pipable)" />
			</codeset>

			<codeset param0="R.U8=cl" param1="M,R" total="7" totalv="7" id="SARUS8-256ToS16_Rcl_MR"
				lostregs="eax" endregs="eax=@0.U32" endpipe="U">
				<line code="mov eax, ecx"  time="U 1" timev=" V1" comment="Move ECX to EAX" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="sar ax, cl"    time="&#45;&#45;4+1"   comment="Shift right" />
				<line code="mov ecx, eax"  time="U 1"             comment="Store it" />
			</codeset>
			<codeset param0="M,R" param1="R.U8=cl" total="5" id="SARUS8-256ToS16_MR_Rcl" endpipe="V">
				<line code="sar @0.U16, cl" time="&#45;&#45;4+1" comment="Shift right" />
			</codeset>

			<codeset param0="R" param1="I" total="2" totalv="2" endpipe="U">
				<line code="sar @0.U16, @1.U8" time="U!1+1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U16" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SHRUS8-256ToU16_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SHRUS8-256ToU16_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SHRUS8-256ToU16_MR_Rcl" />
		</codetypeset>

		<codetypeset param0="S16" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SARUS8-256ToS16_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SARUS8-256ToS16_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SARUS8-256ToS16_MR_Rcl" />
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- ShiftRighting 24bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U24" param1="U/S8-256">
			<codeset param0="M" param1="M,R,I" total="2+?" totalv="1+?" id="SHRUS8-256ToU24_M_MRI"
				lostregs="eax,edx" endregs="edx->@0" endpipe="V">
				<line code="mov al, @1.U8"         time="U 1"   timev=" V1" comment="Get the value to shift by" />
				<line code="lea edx, @0.U8"        time=" V1"   timev="U 1" comment="Get the pointer to our value" />
				<line code="call Mnemonic_SHR_U24" time="!V1+?"             comment="Shift the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="3+?" totalv="2+?" id="SHRUS8-256ToU24_R_MR"
				lostregs="eax,dl" endregs="eax=@0.U24" endpipe="U">
				<line code="mov eax, @0.U32"    time="U 1" timev=" V1" comment="Get the full register value" />
				<line code="mov dl, @1.U8"      time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="Mnemonic_SHR_U24_R" time="!V1+?"           comment="Do the shift" />
				<line code="mov @0.U32, eax"    time="U 1"             comment="Store the result" />
			</codeset>
			<codeset param0="R" param1="R.U8=cl" total="5" totalv="4" id="SHRUS8-256ToU24_R_Rcl" endpipe="V">
				<line code="and @0.U32, 0FFFFFFh" time="U 1" timev=" V1" comment="Clear the high byte" />
				<line code="shr @0.U32, cl"       time="&#45;&#45;4"     comment="Do the shift" />
			</codeset>
			<codeset param0="R" param1="I" total="2" totalv="1"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="and @0.U32, 0FFFFFFh" time="U 1" timev=" V1" comment="Clear the high byte" />
				<line code="shr @0.U32, @1.U8"    time="U!1"             comment="Do the shift" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>

		<codetypeset param0="S24" param1="U/S8-256">
			<codeset param0="M" param1="M,R,I" total="2+?" totalv="1+?" id="SARUS8-256ToS24_M_MRI"
				lostregs="eax,edx" endregs="edx->@0" endpipe="V">
				<line code="mov al, @1.U8"          time="U 1"   timev=" V1" comment="Get the value to shift by" />
				<line code="lea edx, @0.U8"         time=" V1"   timev="U 1" comment="Get the pointer to our value" />
				<line code="call Mnemonic_SAR_US24" time="!V1+?"             comment="Shift the value" />
			</codeset>

			<codeset param0="R" param1="M,R" total="3+?" totalv="2+?" id="SARUS8-256ToS24_R_MR"
				lostregs="eax,dl" endregs="eax=@0.S24" endpipe="U">
				<line code="mov eax, @0.U32"         time="U 1" timev=" V1" comment="Get the value to shift" />
				<line code="mov dl, @1.U8"           time=" V1" timev="U 1" comment="Get the amount to shift" />
				<line code="call Mnemonic_SAR_S24_R" time="!V1+?"           comment="Shift it" />
				<line code="mov @0.U32, eax"         time="U 1"             comment="Store the result" />
			</codeset>
			<codeset param0="R" param1="I" total="2"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="shl @0.U32, 8"       time="U!1" comment="Shift it to the high byte" />
				<line code="sar @0.U32, @1.U8+8" time="U!1" comment="Do the shift 8 more than expected" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U24" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SHRUS8-256ToU24_M_MRI" />
			<codeset param0="R" param1="M,R" sameas="SHRUS8-256ToU24_R_MR" />
			<codeset param0="R" param1="R.U8=cl" sameas="SHRUS8-256ToU24_R_Rcl" />
		</codetypeset>

		<codetypeset param0="S24" param1="Boolean">
			<codeset param0="M" param1="M,R" sameas="SARUS8-256ToS24_M_MRI" />
			<codeset param0="R" param1="M,R" sameas="SARUS8-256ToS24_R_MR" />
		</codetypeset>


		<!-- ********************************************************************************************************** -->
		<!-- ShiftRighting 32bit values -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U32" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="6" totalv="6" id="SHRUS8-256ToU32_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"     time="U 1" timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8"  time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="shr @0.U32, cl" time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"     time="U 1"             comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="3" endpipe="V">
				<line code="shr @0.U32, @1.U8" time="&#45;&#45;3" comment="Shift right (assume not pipable)" />
			</codeset>

			<codeset param0="R.U8=cl" param1="M,R" total="6" totalv="6" id="SHRUS8-256ToU32_Rcl_MR"
				lostregs="eax" endregs="eax=@0.U32" endpipe="U">
				<line code="mov eax, ecx"  time="U 1" timev=" V1" comment="Move ECX to EAX" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="shr eax, cl"   time="&#45;&#45;4"     comment="Shift right the full register value" />
				<line code="mov ecx, eax"  time="U 1"             comment="Store it" />
			</codeset>
			<codeset param0="M,R" param1="R.U8=cl" total="4" id="SHRUS8-256ToU32_MR_Rcl" endpipe="V">
				<line code="shr @0.U32, cl" time="&#45;&#45;4" comment="Shift right" />
			</codeset>
			<codeset param0="R" param1="I" total="1" endpipe="U">
				<line code="shr @0.U32, @1.U8" time="U!1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>

		<codetypeset param0="S32" param1="U/S8-256">
			<codeset param0="M,R" param1="M,R" total="6" totalv="6" id="SARUS8-256ToS32_MR_MR"
				lostregs="al" endregs="al=cl" endpipe="U">
				<line code="mov al, cl"     time="U 1" timev=" V1" comment="Save CL" />
				<line code="mov cl, @1.U8"  time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="sar @0.U32, cl" time="&#45;&#45;4"     comment="Shift right" />
				<line code="mov cl, al"     time="U 1"             comment="Get CL back" />
			</codeset>
			<codeset param0="M" param1="I" total="3" endpipe="V">
				<line code="sar @0.U32, @1.U8" time="&#45;&#45;3" comment="Shift right (assume not pipable)" />
			</codeset>

			<codeset param0="R.U8=cl" param1="M,R" total="6" totalv="6" id="SARUS8-256ToS32_Rcl_MR"
				lostregs="eax" endregs="eax=@0.U32" endpipe="U">
				<line code="mov eax, ecx"  time="U 1" timev=" V1" comment="Move ECX to EAX" />
				<line code="mov cl, @1.U8" time=" V1" timev="U 1" comment="Get the value to shift by" />
				<line code="sar eax, cl"   time="&#45;&#45;4"     comment="Shift right the full register value" />
				<line code="mov ecx, eax"  time="U 1"             comment="Store it" />
			</codeset>
			<codeset param0="M,R" param1="R.U8=cl" total="4" id="SARUS8-256ToS32_MR_Rcl" endpipe="V">
				<line code="sar @0.U32, cl" time="&#45;&#45;4" comment="Shift right" />
			</codeset>

			<codeset param0="R" param1="I" total="1" endpipe="U">
				<line code="sar @0.U32, @1.U8" time="U!1" comment="Shift right" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->

		<!-- ====================================================================================== -->
		<!-- Unsigned/Logical Shift Right -->
		<codetypeset param0="U32" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SHRUS8-256ToU32_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SHRUS8-256ToU32_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SHRUS8-256ToU32_MR_Rcl" />
		</codetypeset>

		<codetypeset param0="S32" param1="Boolean">
			<codeset param0="M,R" param1="M,R" sameas="SARUS8-256ToS32_MR_MR" />
			<codeset param0="R.U8=cl" param1="M,R" sameas="SARUS8-256ToS32_Rcl_MR" />
			<codeset param0="M,R" param1="R.U8=cl" sameas="SARUS8-256ToS32_MR_Rcl" />
		</codetypeset>



		<!-- ********************************************************************************************************** -->
		<!-- ShiftRighting Boolean -->

		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From 8-256bit -->
		<codetypeset param0="Boolean" param1="U/S8-256">
			<!-- 1/0 Version -->
			<codeset param0="M,R" param1="M" total="3-7" totalv="3-8" endpipe="?">
				<line code="cmp @1.U8, 0" time="U 2"      timev=" V2"      comment="Test if it's zero" />
				<line code="je > @l1"     time="!V1(+4?)" timev="!V1(+5?)" comment="If it's zero, do nothing" />
				<line code="mov @0.U8, 0" time="U 1"                       comment="Set it to zero" />
				<line code="@l1:" />
			</codeset>
			<codeset param0="M,R" param1="R" total="2-6" totalv="2-7" endpipe="?">
				<line code="test @1.U8, @1.U8" time="U 1"      timev=" V1"      comment="Test if it's zero" />
				<line code="jz > @l1"          time="!V1(+4?)" timev="!V1(+5?)" comment="If it's zero, do nothing" />
				<line code="mov @0.U8, 0"      time="U 1"                       comment="Set it to zero" />
				<line code="@l1:" />
			</codeset>

			<codeset param0="M" param1="R.U8=cl" total="7" endpipe="V">
				<line code="shr @0.U8, cl" time="&#45;&#45;4" comment="Shift right" />
				<line code="and @0.U8, 1"  time="U 3"         comment="Keep only the low bit" />
			</codeset>
			<codeset param0="R" param1="R.U8=cl" total="5" endpipe="V">
				<line code="shr @0.U8, cl" time="&#45;&#45;4" comment="Shift right" />
				<line code="and @0.U8, 1"  time="U 1"         comment="Keep only the low bit" />
			</codeset>
		</codetypeset>


		<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
		<!-- From Boolean -->
		<codetypeset param0="Boolean" param1="Boolean">
			<!-- Bit shifting Boolean by Boolean is the same as ANDNOT -->
			<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 shift value" />
				<line code="xor al, 1"     time="U*1" timev="U 1" comment="Swap the bit" />
				<line code="and @0.U8, al" time="U*3"             comment="ANDNOT with the value" />
			</codeset>
			<codeset param0="M" param1="V" total="4" totalv="3"
				lostregs="@1.U8" endpipe="U">
				<line code="xor @1.U8, 1"     time="U 1" timev=" V1" comment="Swap the bit" />
				<line code="and @0.U8, @1.U8" time="U*3"             comment="ANDNOT with the value" />
			</codeset>
			<codeset param0="M,R" param1="I" total="1" totalv="0" endpipe="S">
				<line code="mov @0.U8, 0" time="U 1" timev=" V1" comment="Clear to zero" />
			</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 shift value" />
				<line code="xor al, 1"     time="U*1" timev="U 1" comment="Swap the bit" />
				<line code="and @0.U8, al" time="U*1"             comment="ANDNOT with the value" />
			</codeset>

			<codeset param0="M,R" param1="I=0" total="0" endpipe="-">
				<!-- Do Nothing -->
			</codeset>
		</codetypeset>
	</mnemonic>
</encoding>
