4 ms·
Assembly programmer writes in C for first time
- crooked-v 8y agoNext 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.
- lioeters 8y agoThe latest comment on the gist is gold! It's like watching a conversation in code.
- app4soft 8y agoTL;DR: L_.str: ## @.str
- exikyut 8y agoThis 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-assembler-output-from-c-c-source-in-gcc 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/ https://gcc.godbolt.org/
- seisvelas 8y agoI'm a hobbyist, but I'm applying to get into an awesome program called hola<code/> here in CDMX.
- exikyut 8y agoOh, 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.
- Vendan 8y agoint ebx = 0; but movl $1, %ebx .... FAIL.. :D
- seisvelas 8y agoThat'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!