I made an 8086 emulation library ( <a href="https://bitbucket.org/earlz/x86lib/src" rel="nofollow">https://bitbucket.org/earlz/x86lib/src</a>) a while back and it was extremely fun to get so intimate with machine code.<p>I can't remember the exact resource I used for the opcodes and their encodings, but it was the best resource ever. It included cycle information, a description of what the opcode did, and what flags and registers it affected. I haven't been able to find that resource though in a couple years at least. It followed some common template that was used for a number of other topics as well (including DOS interrupts and some obscure programming language)<p>One of the other fun things I did was craft some self-modifying code... although I once had a bug in it and that was almost impossible to debug
Computers up until the early 80s had "keys" to flip bits directly in memory, from the hobbyist Altair 8800 and its clones ( see the close up panel image at the bottom of <a href="http://www.vintage-computer.com/altair8800.shtml" rel="nofollow">http://www.vintage-computer.com/altair8800.shtml</a> ), the DEC PDP series ( <a href="http://home.earthlink.net/~n1be/pdp11/PDP11.html" rel="nofollow">http://home.earthlink.net/~n1be/pdp11/PDP11.html</a> ), Data General Nova...<p>And back in ye old times, the legendary Seymour Cray cold-booted the CDC 1604 for the first time directly from the keys on the front panel before any OS or software existed to run on the machine.
If I run the fib example on a Linux 64bit install and forget the -m32 flag (both GCC and Clang) it will return 0 for each call (the earlier return 42 example worked thou), add the flag and it works. Curious to know what change caused that?
I have been personally diving into compilers lately, and the amount of research which obviously went into this is pretty high (there are at least 3-4 independent resources which are required to find the right opcodes and ordering and...).<p>Well done and presented!