Hi, I have the following code

tadj Proc 

Local col
mov ecx,[edi].GC.h
sub ecx,edx
imul ecx,[edi].GC.w
add eax,ecx
mov ebx,[edi].GC.b.p
lea ebx,[ebx][eax*4]

mov ecx,[esi]
shr ecx,24
;nd ecx,0ffh

push ebx
mov ebx,dword ptr [ebx]

mov eax,ebx
mov edx,[esi]
and edx,0ffh
and eax,0ffh
sub edx,eax
imul edx,ecx
sar edx,8
add eax,edx
mov byte ptr col,al

mov eax,ebx
mov edx,[esi]
shr eax,8
shr edx,8
and edx,0ffh
and eax,0ffh
sub edx,eax
imul edx,ecx
sar edx,8
add eax,edx
mov byte ptr col[1],al

mov eax,ebx
mov edx,[esi]
shr eax,16
shr edx,16
and edx,0ffh
and eax,0ffh
sub edx,eax
imul edx,ecx
sar edx,8
add eax,edx
mov byte ptr col[2],al

mov eax,col
pop ebx
mov dword ptr [ebx],eax
ret
tadj EndP


Its a pixel plotting routine that works in a DIBSection and its written to allow tranparent plotting.

Anyway, I'd love to know if it could be optimised with mmx instructions, maybe someone already has an optimised version of this somewhere.

Otherwise if anyone can point me to some sources on mmx instructions, listings, help files, etc so that I could teach myself I'd also be most grateful.

I tried searching google but to no avail, theres not alot of assembly info on the more advanced instruction sets, and I'd love to study them.

:stupid: Thanks.
Posted on 2001-10-06 07:47:53 by Eóin
Look at developer.intel.com and download some of .pdf manuals. There are all the informations you need about the MMX, SSE, etc.

The exact address for Pentium IV manuals is:
http://developer.intel.com/design/pentium4/manuals/
You will find Volume 2 the most useful.
Posted on 2001-10-07 07:28:31 by Tomasz Grysztar