Results 1 to 4 of 4

Thread: asm output

  1. #1

    asm output

    using a bidimensional array
    [pascal]httpstream.pas.283: Result := @inbuffer[Cursor];
    0042B024 8B5054 mov edx,[eax+$54]
    0042B027 C1E207 shl edx,$07
    0042B02A 8D44D05C lea eax,[eax+edx*8+$5c][/pascal]
    [pascal]httpstream.pas.193: FHTTP.RecvBufferEx(@inbuffer[Feed, bytesreceived], bytestoreceive, MaxInt);
    0042AD62 68FFFFFF7F push $7fffffff
    0042AD67 8B4358 mov eax,[ebx+$58]
    0042AD6A C1E007 shl eax,$07
    0042AD6D 8D04C3 lea eax,[ebx+eax*8]
    0042AD70 8B55F8 mov edx,[ebp-$08]
    0042AD73 8D54105C lea edx,[eax+edx+$5c]
    0042AD77 8BCE mov ecx,esi
    0042AD79 8B4344 mov eax,[ebx+$44]
    0042AD7C 8B38 mov edi,[eax]
    0042AD7E FF5740 call dword ptr [edi+$40][/pascal]

    using a linear array
    [pascal]httpstream.pas.283: Result := @inbuffer[Cursor * BUFFSIZE];
    0042B020 8B5054 mov edx,[eax+$54]
    0042B023 C1E20A shl edx,$0a
    0042B026 8D44105C lea eax,[eax+edx+$5c][/pascal]
    [pascal]httpstream.pas.193: FHTTP.RecvBufferEx(@inbuffer[Feed * BUFFSIZE + bytesreceived], bytestoreceive, MaxInt);
    0042BAEA 68FFFFFF7F push $7fffffff
    0042BAEF 8B4358 mov eax,[ebx+$58]
    0042BAF2 C1E00A shl eax,$0a
    0042BAF5 0345F8 add eax,[ebp-$08]
    0042BAF8 8D54035C lea edx,[ebx+eax+$5c]
    0042BAFC 8BCE mov ecx,esi
    0042BAFE 8B4344 mov eax,[ebx+$44]
    0042BB01 8B38 mov edi,[eax]
    0042BB03 FF5740 call dword ptr [edi+$40][/pascal]

    i don't know much about asm, but witch version will be faster?

    the "eax*8" on first and second codes really means a multiplication of eax register by eight ?
    From brazil (:

    Pascal pownz!

  2. #2

    asm output

    There won't be any measurable difference - or any difference at all.
    Yes.

  3. #3

    asm output

    Yeah, as Imcold says, there's no difference at all. They amount to the same amount of cpu clocks

    And yes, the *8 means multiplied by eight, but there's the same thing going on in the second [eax+edx+$5c]
    Here edx is multiplied by 1, but the multiplication is handled by shifting edx a little more in the former instruction. This might be slightly faster but still only something you couldn't measure
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  4. #4

    asm output

    Interesting, thanks for the explanation guys
    From brazil (:

    Pascal pownz!

Bookmarks

Posting Permissions

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