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

The cleverest person on /prog? (currently) challenge!

Name: Anonymous 2016-08-19 12:32

challenges tba by challengers!
1 on 1 battles!

Name: Cudder !cXCudderUE 2016-08-21 13:13

>>12
Did you want a goto instead?

Here's the Asm version. Amusingly enough, it's also 20 lines like the C version, but only 33 bytes compared to the 68 bytes the compiler output with max optimisations. Without opts, it's 112(!) bytes.

traverse: ; ecx:prectx edx:postctx ebx:e esi:pre edi:post
mov ebp, ebx
loop1:
mov eax, ebx
call esi
mov ebx, [eax+Node.firstchild]
test ebx, ebx
jnz loop1
loop2:
call edi
mov ebx, [eax+Node.nextsib]
test ebx, ebx
jnz loop1
cmp eax, ebp
jz traverse_ret
mov eax, [eax+Node.parent]
test eax, eax
jnz loop2
traverse_ret:
ret

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