4 ms·
In the postscript he mentions: [...] Well, actually, it could be made smaller. When Linux starts up a new executable, one of the things it does is zero out the
by silvajoao 17y ago
In the postscript he mentions:
[...] Well, actually, it could be made smaller. When Linux starts up a new executable, one of the things it does is zero out the accumulator (as well as most of the other registers). Taking advantage of this fact would have allowed me to remove the xor [...]
Removing the xor reduces the program size to 43 bytes. Closer, but not there yet :-)
However, neither the original nor the 43-byte version run on my machine [1]. The first is simply Killed, the second doesn't even load: cannot execute binary file.
[1] Linux 2.6.28 i686 (Ubuntu 9.04 on Pentium M)
- kelnos 17y agoThe original runs fine for me[1], but if you actually read the last bit of the article, you'll see that there's no way to get it below 45 bytes and convince the kernel to still run it. The 45th byte specifies the number of entries in the program header table, and that can't be zero (or missing). [1] Linux 2.6.31 x86_64