PADDSB
Usage: PADDSB dest,src Modifies flags: None
Performs an SIMD add of the packed signed integers from the 'src' and the 'dest', and stores the packed integer results in the 'dest' operand. These instructions can operate on either 64-bit or 128-bit operands.
Add Packed Signed Integers With Saturation
PADDSB mm1,mm2/m64 ; 0F EC /r [PENT,MMX]
PADDSW mm1,mm2/m64 ; 0F ED /r [PENT,MMX]
PADDSB xmm1,xmm2/m128 ; 66 0F EC /r [WILLAMETTE,SSE2]
PADDSW xmm1,xmm2/m128 ; 66 0F ED /r [WILLAMETTE,SSE2]
PADDSx performs packed addition of the two operands, storing the result in the destination (first) operand. PADDSB treats the operands as packed bytes, and adds each byte individually; and PADDSW treats the operands as packed words.
When an individual result is too large to fit in its destination, a saturated value is stored. The resulting value is the value with the largest magnitude of the same sign as the result which will fit in the available space.
EXAMPLE:
paddsb xmm1 Label
PADDQ
Usage: PADDQ dest,src Modifies flags: None
Adds the 'dest' to the 'src' operand and stores the result in the 'dest' operand.
Add Packed Quadword Integers
PADDQ mm1,mm2/m64 ; 0F D4 /r [PENT,MMX]
PADDQ xmm1,xmm2/m128 ; 66 0F D4 /r [WILLAMETTE,SSE2]
PADDQ adds the quadwords in the source and destination operands, and stores the result in the destination register.
When a quadword result is too large to be represented in 64 bits (overflow), the result is wrapped around and the low 64 bits are written to the 'dest' element (that is, the carry is ignored).
The 'src' operand can be a quadword integer stored in an MMX technology register or a 64-bit memory location, or it can be two packed quadword integers stored in an XMM register or an 128-bit memory location.
The 'dest' operand can be a quadword integer stored in an MMX technology register or two packed quadword integers stored in an XMM register. When packed quadword operands are used, an SIMD add is performed.
EXAMPLE:
paddq xmm1 Label
PADDD
Usage: PADDD dest,src Modifies flags: None
Performs an SIMD add of the packed integers from the 'src' and the 'dest', and stores the packed integer results in the 'dest' operand.
Add Packed Integers
PADDB mm1,mm2/m64 ; 0F FC /r [PENT,MMX]
PADDW mm1,mm2/m64 ; 0F FD /r [PENT,MMX]
PADDD mm1,mm2/m64 ; 0F FE /r [PENT,MMX]
PADDB xmm1,xmm2/m128 ; 66 0F FC /r [WILLAMETTE,SSE2]
PADDW xmm1,xmm2/m128 ; 66 0F FD /r [WILLAMETTE,SSE2]
PADDD xmm1,xmm2/m128 ; 66 0F FE /r [WILLAMETTE,SSE2]
PADDx performs packed addition of the two operands, storing the result in the destination (first) operand.
PADDB treats the operands as packed bytes, and adds each byte individually;
PADDW treats the operands as packed words;
PADDD treats its operands as packed doublewords.
When an individual result is too large to fit in its destination, it is wrapped around and the low bits are stored, with the carry bit discarded.
EXAMPLE:
paddd xmm1 Label
PADDB
Usage: PADDB dest,src Modifies flags: None
Performs an SIMD add of the packed integers from the 'src' and the 'dest', and stores the packed integer results in the 'dest' operand.
Add Packed Integers
PADDB mm1,mm2/m64 ; 0F FC /r [PENT,MMX]
PADDW mm1,mm2/m64 ; 0F FD /r [PENT,MMX]
PADDD mm1,mm2/m64 ; 0F FE /r [PENT,MMX]
PADDB xmm1,xmm2/m128 ; 66 0F FC /r [WILLAMETTE,SSE2]
PADDW xmm1,xmm2/m128 ; 66 0F FD /r [WILLAMETTE,SSE2]
PADDD xmm1,xmm2/m128 ; 66 0F FE /r [WILLAMETTE,SSE2]
PADDx performs packed addition of the two operands, storing the result in the destination (first) operand.
PADDB treats the operands as packed bytes, and adds each byte individually;
PADDW treats the operands as packed words;
PADDD treats its operands as packed doublewords.
When an individual result is too large to fit in its destination, it is wrapped around and the low bits are stored, with the carry bit discarded.
EXAMPLE:
paddb xmm1 Label
PACKUSWB
Usage: PACKUSWB dest,src Modifies flags: None
Converts 4 or 8 signed word integers from the 'dest' and 4 or 8 signed word integers from the 'src' into 8 or 16 unsigned byte integers and stores the result in the 'dest' operand.
Pack Data
PACKSSDW mm1,mm2/m64 ; 0F 6B /r [PENT,MMX]
PACKSSWB mm1,mm2/m64 ; 0F 63 /r [PENT,MMX]
PACKUSWB mm1,mm2/m64 ; 0F 67 /r [PENT,MMX]
PACKSSDW xmm1,xmm2/m128 ; 66 0F 6B /r [WILLAMETTE,SSE2]
PACKSSWB xmm1,xmm2/m128 ; 66 0F 63 /r [WILLAMETTE,SSE2]
PACKUSWB xmm1,xmm2/m128 ; 66 0F 67 /r [WILLAMETTE,SSE2]
All these instructions start by combining the source and destination operands, and then splitting the result in smaller sections which it then packs into the destination register. The MMX versions pack two 64-bit operands into one 64-bit register, while the SSE versions pack two 128-bit operands into one 128-bit register.
PACKSSWB splits the combined value into words, and then reduces the words to bytes, using signed saturation. It then packs the bytes into the destination register in the same order the words were in.
PACKSSDW performs the same operation as PACKSSWB, except that it reduces doublewords to words, then packs them into the destination register.
PACKUSWB performs the same operation as PACKSSWB, except that it uses unsigned saturation when reducing the size of the elements.
To perform signed saturation on a number, it is replaced by the largest signed number (FFFh or Fh) that fit, and if it is too small it is replaced by the smallest signed number (h or h) that will fit. To perform unsigned saturation, the input is treated as unsigned, and the input is replaced by the largest unsigned number that will fit.
EXAMPLE:
packuswb xmm1 Label
PACKSSWB
Usage: PACKSSWB dest,src Modifies flags: None
Converts 4 or 8 signed word integers from the 'dest' and 4 or 8 signed word integers from the 'src' into 8 or 16 unsigned byte integers and stores the result in the 'dest' operand.
Pack Data
PACKSSDW mm1,mm2/m64 ; 0F 6B /r [PENT,MMX]
PACKSSWB mm1,mm2/m64 ; 0F 63 /r [PENT,MMX]
PACKUSWB mm1,mm2/m64 ; 0F 67 /r [PENT,MMX]
PACKSSDW xmm1,xmm2/m128 ; 66 0F 6B /r [WILLAMETTE,SSE2]
PACKSSWB xmm1,xmm2/m128 ; 66 0F 63 /r [WILLAMETTE,SSE2]
PACKUSWB xmm1,xmm2/m128 ; 66 0F 67 /r [WILLAMETTE,SSE2]
All these instructions start by combining the source and destination operands, and then splitting the result in smaller sections which it then packs into the destination register. The MMX versions pack two 64-bit operands into one 64-bit register, while the SSE versions pack two 128-bit operands into one 128-bit register.
PACKSSWB splits the combined value into words, and then reduces the words to bytes, using signed saturation. It then packs the bytes into the destination register in the same order the words were in.
PACKSSDW performs the same operation as PACKSSWB, except that it reduces doublewords to words, then packs them into the destination register.
PACKUSWB performs the same operation as PACKSSWB, except that it uses unsigned saturation when reducing the size of the elements.
To perform signed saturation on a number, it is replaced by the largest signed number (FFFh or Fh) that fit, and if it is too small it is replaced by the smallest signed number (h or h) that will fit. To perform unsigned saturation, the input is treated as unsigned, and the input is replaced by the largest unsigned number that will fit.
EXAMPLE:
packsswb xmm1 Label
PACKSSDW
Usage: PACKSSDW dest,src Modifies flags: None
Converts packed signed word integers into packed signed byte integers (PACKSSWB) or converts packed signed doubleword integers into packed signed word integers (PACKSSDW), using saturation to handle overflow conditions.
Pack Data
PACKSSDW mm1,mm2/m64 ; 0F 6B /r [PENT,MMX]
PACKSSWB mm1,mm2/m64 ; 0F 63 /r [PENT,MMX]
PACKUSWB mm1,mm2/m64 ; 0F 67 /r [PENT,MMX]
PACKSSDW xmm1,xmm2/m128 ; 66 0F 6B /r [WILLAMETTE,SSE2]
PACKSSWB xmm1,xmm2/m128 ; 66 0F 63 /r [WILLAMETTE,SSE2]
PACKUSWB xmm1,xmm2/m128 ; 66 0F 67 /r [WILLAMETTE,SSE2]
All these instructions start by combining the source and destination operands, and then splitting the result in smaller sections which it then packs into the destination register. The MMX versions pack two 64-bit operands into one 64-bit register, while the SSE versions pack two 128-bit operands into one 128-bit register.
PACKSSWB splits the combined value into words, and then reduces the words to bytes, using signed saturation. It then packs the bytes into the destination register in the same order the words were in.
PACKSSDW performs the same operation as PACKSSWB, except that it reduces doublewords to words, then packs them into the destination register.
PACKUSWB performs the same operation as PACKSSWB, except that it uses unsigned saturation when reducing the size of the elements.
To perform signed saturation on a number, it is replaced by the largest signed number (FFFh or Fh) that fit, and if it is too small it is replaced by the smallest signed number (h or h) that will fit. To perform unsigned saturation, the input is treated as unsigned, and the input is replaced by the largest unsigned number that will fit.
EXAMPLE:
packssdw xmm1 Label
OUTSW
Usage: OUTSW port,src Modifies flags: None
Transfers a byte, word or doubleword from 'src' to the hardware port specified in DX. For instructions with no operands the 'src' is located at DS:SI and SI is incremented or decremented by the size of the operand or the size set by the instruction format. When the Direction Flag is set SI is decremented, when clear, SI is incremented.
Output String to I/O Port
OUTSB ; 6E [186]
OUTSW ; o16 6F [186]
OUTSD ; o32 6F [386]
OUTSB loads a byte from ESI and writes it to the I/O port specified in DX. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) ESI.
OUTSW and OUTSD work in the same way, but they output a word or a doubleword instead of a byte, and increment or decrement the addressing registers by 2 or 4 instead of 1.
If the port number is in the range of 0-255 it can be specified as an immediate. If greater than 255 then the port number must be specified in DX. Since the PC only decodes 10 bits of the port address, values over 1023 can only be decoded by third party vendor equipment and also map to the port range 0-1023.
The REP prefix may be used to repeat the instruction ECX times.
EXAMPLE:
mov dx 10
outsw
OUTSD
Usage: OUTSD port,src Modifies flags: None
Transfers a byte, word or doubleword from 'src' to the hardware 'port' specified in DX. For instructions with no operands the 'src' is located at DS:SI and SI is incremented or decremented by the size of the operand or the size set by the instruction format.
Output String to I/O Port
OUTSB ; 6E [186]
OUTSW ; o16 6F [186]
OUTSD ; o32 6F [386]
OUTSB loads a byte from ESI and writes it to the I/O port specified in DX. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) ESI.
OUTSW and OUTSD work in the same way, but they output a word or a doubleword instead of a byte, and increment or decrement the addressing registers by 2 or 4 instead of 1.
When the Direction Flag is set SI is decremented, when clear, SI is incremented. If the port number is in the range of 0-255 it can be specified as an immediate. If greater than 255 then the port number must be specified in DX. Since the PC only decodes 10 bits of the port address, values over 1023 can only be decoded by third party vendor equipment and also map to the port range 0-1023.
The REP prefix may be used to repeat the instruction ECX times.
EXAMPLE:
mov dx 100
outsd
OUTSB
Usage: OUTSB port,src Modifies flags: None
Transfers a byte, word or doubleword from 'src' to the hardware 'port' specified in DX. For instructions with no operands the 'src' is located at DS:SI and SI is incremented or decremented by the size of the operand or the size dictated by the instruction format. When the Direction Flag is set SI is decremented, when clear, SI is incremented.
Output String to I/O Port
OUTSB ; 6E [186]
OUTSW ; o16 6F [186]
OUTSD ; o32 6F [386]
OUTSB loads a byte from ESI and writes it to the I/O port specified in DX. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) ESI.
OUTSW and OUTSD work in the same way, but they output a word or a doubleword instead of a byte, and increment or decrement the addressing registers by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction ECX times.
If the port number is in the range of 0-255 it can be specified as an immediate. If greater than 255 then the port number must be specified in DX. Since the PC only decodes 10 bits of the port address, values over 1023 can only be decoded by third party vendor equipment and also map to the port range 0-1023.
Example:
mov dx 115
outsb
or
outsb 15