8 comments

[ 0.25 ms ] story [ 23.5 ms ] thread
Next would probably be a while loop using the same setup, then a for loop with the counter reversed (incrementing rather than decrementing), and seeing how the assembly differs in each case. If you were using C++ then next after that would be using an iterator on a vector and mostly taking away direct control of the counter in the process.
The latest comment on the gist is gold! It's like watching a conversation in code.
This is GAS syntax x86. I am very interested to learn what sort of context you do assembly language programming mainly.

Heh. If this were 10 years ago, we'd be using register ints.

As I'm sure you're aware you can get gcc to emit assembly, quite a few of the answers here seem interesting: https://stackoverflow.com/questions/137038/how-do-you-get-as...

You don't need to parallel-install dozens of versions of different compilers to play with them, too: https://gcc.godbolt.org/

I'm a hobbyist, but I'm applying to get into an awesome program called hola<code/> here in CDMX.
Oh, that sounds interesting. Definitely hope it works out for you!

I must admit my great curiosity about what path led you to assembly language and _then_ C. In many circumstances it's the other way around.

    int ebx = 0;
but

    movl $1, %ebx
.... FAIL.. :D
That's actually a copy/paste error, the original assembly goes like this:

    movl $10, %edi # number of fibnum we hunt
    movl $0, %ebx # 1st fibnum
    movl $1, %eax # 2nd fibnum
Updated the gist, thanks!