Results 1 to 2 of 2

Thread: Help a 100% Newbie ?

  1. #1

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Hi there,

    I have no experience in assembly...asm... or whatever.
    But could you tell me what the following lines do :

    Code:
    		for (i = 0; i < filesize; i += 32, j++) {	
    			fread(&RomMemory[i], 32, 1, romfp);
    
    			_asm {
    				mov edx, dword ptr RomMemory
    				add edx, i
    
    				movq mm0, qword ptr [edx]
    				movq mm2, qword ptr [edx+8]
    				movq mm4, qword ptr [edx+16]
    				movq mm6, qword ptr [edx+24]
    
    				movq mm1, mm0
    				psrlw mm0, 8
    				psllw mm1, 8
    				por mm0, mm1
    
    				movq mm3, mm2
    				psrlw mm2, 8
    				psllw mm3, 8
    				por mm2, mm3
    
    				movq mm5, mm4
    				psrlw mm4, 8
    				psllw mm5, 8
    				por mm4, mm5
    
    				movq mm7, mm6
    				psrlw mm6, 8
    				psllw mm7, 8
    				por mm6, mm7
    
    				movq qword ptr [edx], mm0
    				movq qword ptr [edx+8], mm2
    				movq qword ptr [edx+16], mm4
    				movq qword ptr [edx+24], mm6
    			}
    Im guessing they're swapping each two characters in a file or something, but im not quite sure.
    Any ideas ?

    - Jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004


    What instruction set are you using?
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width