Hello everyone, I hope I have posted this in the correct forum. I have a good knowledge of VB.Net and VC++ and have now takent he brave step into assembly level programming. I'm starting out with just a bit of inline assembly in a c++ program and toying around with MMX. What i'm struggling with is what MMX actually does with certain instructions. I know it's designed to operate on packed data values but having read a wealth of documentation on it I'm still not getting how the follwing instructions work. Example.... Lets say I have a BYTE pointer to a memory bitmap in 32 bpp format. I use movq to move two pixels or 8 bytes of memory into an mmx register. Now the problems begin, unpacking and manipulating the individual BGRA components. I think I need the following instruction, i just don't know how to use it properly. Lamens terms would be very much appreciated.
punpcklbw ???
bytePtr // Pointer to first byte of 32bpp memory bitmap;
__asm
{
pushad; // Push all 32 bit registers onto the stack
mov esi, DWORD PTR [bytePtr] // move the pointer into esi.
//Start MMX
movq mm0, esi; // Move quadword (two pixles into mm0)
/// Problems here, for now just a simple example on how to add the value of 1 to each BGRA value. I can use "paddusb" to add a value to the first Blue value but I don't know how to add a value to the rest. I'm sure I have to unpack the data but i need some help.