of course, this is not a comprehensive list; just some notes of fun/interesting things I discovered

See also

Memory operand format

  • offset(base_register, index_register, scale)
  • Computed as offset + base_register + index_register*scale

MOV 's

  • movaps %xmm2, %xmm3 - copies %xmm2 into %xmm3
  • movups - same as MOVAPS, except it's ok with unaligned loads
  • movdqa - move aligned dual quad word

Math

  • PAVGB packed (?) average-by-byte
    • PAVGW packed average-by-word
  • MULPS
    • mulps %xmm1, %xmm2 - answer overwrites %xmm2

SSE

blendvps

  • uses mask in xmm0 to

Compares

CMPLTPS

  • Compare less than parallel. Sets 1 or 0 in each of the 32 bit dst subsections according to the corresponding ones in the source

XORPS

XCHG

  • lets you swap higher & lower portions of registers
  • e.g. XCHG CL, CH swaps the upper and lower halves of CX
  • but you can also do XCHG CL, AH to put the upper half of AX into the lower half of CX

TEST

  • like and except the operand doesn't change - but the flags do.
  • testb tests bytes, testw tests words, and testl tests double words, and testq (x86-64 only) tests quad words
  • example: test ax, (bits). The zero flag is set if no bits match. The zero flag will be cleared if any bits match
  • how to check if more than 1 bit is set? Invert the operand (ax in this example), TEST, and if the zero flag is set you have a match of both bits

PUSH

  • sticks argument at esp (or rsp with x86-64) and decrements it by the appropriate size
    • so, if rsp = 0x7fbffff728, pushq %rdb puts the 8 byte x86-64 register at 0x7fbffff728 and changes rsp to be 0x7fbffff720

-- MattWalsh - 16 Apr 2004

Topic revision: r5 - 28 Aug 2009 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback