|
|
|
|
|
by pbsd
4571 days ago
|
|
Agree, AT&T syntax was just not designed for human reading. I doubt this is too optimized for size, since there are obvious tricks that it misses. Another observation: the strlen code is incorrect, as it also counts the \0. We can fix this, and make the code 1 byte shorter (in glorious Intel syntax): lea esi, source ; depends on source
xor ecx, ecx ; 2 bytes
salc ; 1 byte
cld ; 1 byte
_back:
scasb ; 1 byte
loopnz _back ; 2 bytes
not ecx ; 2 bytes
|
|