⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmx_chp5.htm

📁 MMX即多媒体可扩展指令集
💻 HTM
📖 第 1 页 / 共 5 页
字号:

<H5><a name="PAND">PAND - Bitwise Logical And</a></H5>

<center><table border="0" cellpadding="2" cellspacing="1" bgcolor="#EBDABE">
<TR><TD bgcolor="#000000" WIDTH=106><small><B>Opcode</small></B></TD><TD bgcolor="#000000" WIDTH=123><small><B>Instruction</small></B>
</TD><TD bgcolor="#000000" WIDTH=288><small><B>Description</small></B></TD>
</TR>

<TR><TD bgcolor="#000000" WIDTH=106><small>0F DB /r</small></TD><TD bgcolor="#000000" WIDTH=123><small>PAND <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>AND 64 bits from MMX register/memory to MMX register.</small>
</TD></TR>
</TABLE></CENTER>

<br>
<B>Operation</B><br><br>

mm&lt;--mm AND mm/m64;<br><br>

<B>Description</B><br><br>

The PAND instruction performs a bitwise logical AND on 64 bits of the source and destination operands, and writes the result to the destination operand.<br><br>

Each bit of the result of the PAND instruction is set to 1 if the corresponding bits of the operands are 1. Otherwise, it is set to 0.<br><br>

The destination operand is an MMX register. The source operand can either be an MMX register or a 64-bit memory operand.<br><br>

<B>Example</B><br><br>

<CENTER><IMG SRC="3006019.gif" tppabs="http://freemind.163.net/database/mmx/3006019.gif" border=0></CENTER><br>

<B>Flags Affected</B><br><br>

None.<br><br>

<B>Protected Mode Exceptions</B><br><br>

#GP(0) for an illegal memory operand effective address
in the CS, DS, ES, FS or GS segments; #SS(0) for an illegal address
in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned
memory reference if the current privilege level is 3; #UD if CR0.EM
= 1; #NM if TS bit in CR0 is set; #MF if there is a pending FPU
exception.<br><br>

<B>Real Address Mode Exceptions </B><br><br>

Interrupt 13 if any part of the operand lies outside
of the effective address space from 0 to 0FFFFH;<B> </B>#UD if
CR0.EM = 1; #NM if TS bit in CR0 is set; #MF if there is a pending
FPU exception.<br><br>

<B>Virtual 8086 Mode Exceptions</B><br><br>

Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference.<br><br>

<table border="0" width="100%"><tr><td bgcolor="#CBBA9E" height="1"></td></tr></table>

<H5><a name="PANDN">PANDN - Bitwise Logical And Not</a></H5>

<center><table border="0" cellpadding="2" cellspacing="1" bgcolor="#EBDABE">
<TR><TD bgcolor="#000000" WIDTH=111><small><B>Opcode</small></B></TD><TD bgcolor="#000000" WIDTH=125><small><B>Instruction</small></B>
</TD><TD bgcolor="#000000" WIDTH=274><small><B>Description</small></B></TD>
</TR>

<TR><TD bgcolor="#000000" WIDTH=111><small>0F DF /r</small></TD><TD bgcolor="#000000" WIDTH=125><small>PANDN <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=274><small>Invert the 64 bits in MMX register, AND inverted MMX register with MMX register/memory.</small>
</TD></TR>
</TABLE></CENTER>

<br>
<B>Operation</B><br><br>

mm&lt;--(NOT mm) AND mm/m64;<br><br>

<B>Description</B><br><br>

The PANDN instruction performs a bitwise logical
NOT on the 64 bits of the destination operand. The NOT inverts
each of the 64 bits of the destination register so that every
1 becomes a 0, and visa versa.<br><br>

The instruction then performs a bitwise logical AND
on the inverted 64 bits of the destination operand and on the
source operand. Each bit of the result of the AND instruction
is set to 1 if the corresponding bits are 1. Otherwise, it is
set to 0. The result is written to the destination register.<br><br>

The destination operand is an MMX register. The source
operand can either be an MMX register or a 64-bit memory operand.<br><br>

<B>Example</B><br><br>

<CENTER><IMG SRC="3006018.gif" tppabs="http://freemind.163.net/database/mmx/3006018.gif" border=0></CENTER><br>

<B>Flags Affected</B><br><br>

None.<br><br>

<B>Protected Mode Exceptions</B><br><br>

#GP(0) for an illegal memory operand effective address
in the CS, DS, ES, FS or GS segments; #SS(0) for an illegal address
in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned
memory reference if the current privilege level is 3; #UD if CR0.EM
= 1; #NM if TS bit in CR0 is set; #MF if there is a pending FPU
exception.<br><br>

<B>Real Address Mode Exceptions</B><br><br>

Interrupt 13 if any part of the operand lies outside
of the effective address space from 0 to 0FFFFH;<B> </B>#UD if
CR0.EM = 1; #NM if TS bit in CR0 is set; #MF if there is a pending
FPU exception.<br><br>

<B>Virtual 8086 Mode Exceptions</B><br><br>

Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference.<br><br>

<table border="0" width="100%"><tr><td bgcolor="#CBBA9E" height="1"></td></tr></table>

<H5><a name="PCMPEQB">PCMPEQB/PCMPEQW/PCMPEQD - Packed Compare for Equal</a></H5>

<center><table border="0" cellpadding="2" cellspacing="1" bgcolor="#EBDABE">
<TR><TD bgcolor="#000000" WIDTH=103><small><B>Opcode</small></B></TD><TD bgcolor="#000000" WIDTH=120><small><B>Instruction</small></B>
</TD><TD bgcolor="#000000" WIDTH=288><small><B>Description</small></B></TD>
</TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>0F 74 /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPEQB <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed byte in MMX register/memory with packed byte in MMX register for equality.</small>
</TD></TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>07, 75, /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPEQW <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed word in MMX register/memory with packed word in MMX register for equality.</small>
</TD></TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>07, 76, /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPEQD <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed dword in MMX register/memory with packed dword in MMX register for equality.</small>
</TD></TR>
</TABLE></center>

<br>
<B>Operation</B><br><br>

IF instruction is PCMPEQB<BR>
THEN {<BR>
&nbsp;&nbsp;&nbsp; IF mm(7..0) = mm/m64(7..0)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(7  0)&lt;--0xFF; <BR>
&nbsp;&nbsp;&nbsp; ELSE mm(7..0)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; IF mm(15..8) = mm/m64(15.. 8)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(15..8)&lt;--0xFF; <BR>
&nbsp;&nbsp;&nbsp; ELSE mm(15..8)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; ...<BR>
&nbsp;&nbsp;&nbsp; IF mm(63..56) = mm/m64(63..56)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(63..56)&lt;--0xFF;<BR>
&nbsp;&nbsp;&nbsp; ELSE mm(63..56)&lt;--0; <BR>
}<br>
ELSE IF instruction is PCMPEQW<BR>
THEN {<BR>
&nbsp;&nbsp;&nbsp; IF mm(15..0) = mm/m64(15..0) <BR>
&nbsp;&nbsp;&nbsp; THEN mm(15..0)&lt;--0xFFFF;<BR>
&nbsp;&nbsp;&nbsp; ELSE mm(15..0)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; IF mm(31..16) = mm/m64(31..16)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(31..16)&lt;--0xFFFF;<BR>
&nbsp;&nbsp;&nbsp; ELSE mm(31..16)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; ...<BR>
&nbsp;&nbsp;&nbsp; IF mm(63..48) = mm/m64(63..48)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(63..48)&lt;--0xFFFF;<BR>
&nbsp;&nbsp;&nbsp; ELSE mm(63..48)&lt;--0;<BR>
}<br>
ELSE { (* instruction is PCMPEQD *)<BR>
&nbsp;&nbsp;&nbsp; IF mm(31..0) = mm/m64(31..0)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(31..0)&lt;--0xFFFFFFFF; <BR>
&nbsp;&nbsp;&nbsp; ELSE mm(31..0)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; IF mm(63..32) = mm/m64(63..32)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(63..32)&lt;--0xFFFFFFFF;<BR>
&nbsp;&nbsp;&nbsp; ELSE mm(63..32)&lt;--0; <BR>
}<br><br>

<B>Description</B><br><br>

The PCMPEQ instructions compare the data elements
in the destination operand to the corresponding data elements
in the source operand. If the data elements are equal, the corresponding
data element in the destination register is set to all ones. If
they are not equal, the corresponding data element is set to all
zeros.<br><br>

The destination operand is an MMX register. The source operand can either be an MMX register or a 64-bit memory operand.<br><br>

The PCMPEQB instruction compares the bytes in the
destination operand to the bytes in the source operand. The bytes
in the destination operand are set accordingly.<br><br>

The PCMPEQW instruction compares the words in the
destination operand to the words in the source operand. The words
in the destination operand are set accordingly.<br><br>

The PCMPEQD instruction compares the doublewords
in the destination operand to the doublewords in the source operand.
The doublewords in the destination operand are set accordingly.<br><br>

<B>Example</B><br><br>

<CENTER><IMG SRC="3006020.gif" tppabs="http://freemind.163.net/database/mmx/3006020.gif" border=0></CENTER><br><br>

<B>Flags Affected</B><br><br>

None.<br><br>

<B>Protected Mode Exceptions</B><br><br>

#GP(0) for an illegal memory operand effective address
in the CS, DS, ES, FS or GS segments; #SS(0) for an illegal address
in the SS segment; #PF(fault-code) for a page fault; #AC for unaligned
memory reference if the current privilege level is 3; #UD if CR0.EM
= 1; #NM if TS bit in CR0 is set; #MF if there is a pending FPU
exception.<br><br>

<B>Real Address Mode Exceptions</B><br><br>

Interrupt 13 if any part of the operand lies outside
of the effective address space from 0 to 0FFFFH;<B> </B>#UD if
CR0.EM = 1; #NM if TS bit in CR0 is set; #MF if there is a pending
FPU exception.<br><br>

<B>Virtual 8086 Mode Exceptions</B><br><br>

Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault; #AC for unaligned memory reference.<br><br>

<table border="0" width="100%"><tr><td bgcolor="#CBBA9E" height="1"></td></tr></table>

<H5><a name="PCMPGTB">PCMPGTB/PCMPGTW/PCMPGTD - Packed Compare for Greater Than</a></H5>

<center><table border="0" cellpadding="2" cellspacing="1" bgcolor="#EBDABE">
<TR><TD bgcolor="#000000" WIDTH=103><small><B>Opcode</small></B></TD><TD bgcolor="#000000" WIDTH=120><small><B>Instruction</small></B>
</TD><TD bgcolor="#000000" WIDTH=288><small><B>Description</small></B></TD>
</TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>0F 64 /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPGTB <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed byte in MMX register  with packed byte in MMX register/memory for greater value.</small>
</TD></TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>0F 65 /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPGTW <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed word in MMX register with packed word in MMX register/memory for greater value.</small>
</TD></TR>

<TR><TD bgcolor="#000000" WIDTH=103><small>0F 66 /r</small></TD><TD bgcolor="#000000" WIDTH=120><small>PCMPGTD <I>mm, mm/m64</I></small>
</TD><TD bgcolor="#000000" WIDTH=288><small>Compare packed dword in MMX register with packed dword in MMX register/memory for greater value.</small>
</TD></TR>
</TABLE></center>

<br>
<B>Operation</B><br><br>

IF instruction is PCMPGTB <BR>
THEN {<BR>
&nbsp;&nbsp;&nbsp; IF mm(7..0) &gt; mm/m64(7..0)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(7  0)&lt;--0xFF; <BR>
&nbsp;&nbsp;&nbsp; ELSE mm(7..0)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; IF mm(15..8) &gt; mm/m64(15.. 8)<BR>
&nbsp;&nbsp;&nbsp; THEN mm(15..8)&lt;--0xFF; <BR>
&nbsp;&nbsp;&nbsp; ELSE mm(15..8)&lt;--0;<BR>
&nbsp;&nbsp;&nbsp; ...<BR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -