Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Delphi...

Name: Anonymous 2011-10-13 15:34

It's 2011, and...

    mov     eax, [ebx]
    mov     edx, [ebp-16]
    mov     [eax+4], edx
    mov     eax, [ebx]     ; WTF? Who changed eax or ebx?
    mov     edx, [ebp-12]
    mov     [eax+8], edx
    mov     eax, [ebx]     ; WTF? Who changed eax or ebx?
    mov     edx, [ebp-8]
    mov     [eax+12], edx

...it's compiler is still being retarded.

(I checked, there are no jumps between there. This is one run of code.)

Name: Anonymous 2011-10-13 16:09

>>2
Or at least use C and Intel's compiler.

>>4
This is a structure (record) assignment from a copy on the stack to a copy in a heap object.

And even if the compiler can't tell if they're aliased or not, it's a little annoying how it keeps using eax and edx. If you look at MSVC or Intel's C/C++ compiler output you'll see how it spreads loads and stores across registers to help with parallelism. Here's another two 'wat' fragments:


    xor eax, eax
    mov [ebp-8], eax
    mov [ebp-12], eax
    mov [ebp-16], 0   ; wat



    mov eax, [esp-8]
    mov ebx, [esp-12]
    mov [ebx+4], eax
    mov ebx, [esp-12]    ; wat
    mov ebx, [esp-16]
    mov [ebx+8], eax

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List