Commit Graph

8 Commits

Author SHA1 Message Date
Elf M. Sternberg 89b58186fb BUG Fix bug in 64-bit subroutine lesson. Streamline 32-bit subroutine lesson.
There was a bug in the 64-bit subroutine lesson that popped the stack
once too many times: there were two pushes but three pops.  That this
didn't generate a stack underflow condition confuses and worries me.
I would have expected a segfault when I decremented the stack counter
once too often.  This makes me wonder if I understand this program well
enough.

The effect on the registers was, fortunately, harmless as the next step
completely repurposed the registers to initialize the exit() routine.

Once I'd figured out how to use the RSI and RAX registers correctly, I
streamlined the 32-bit version so that the products of strlen(), the
start and length of the message, were already in the registers when I
issued my syscall to WRITE().  I'm sure this is, in some ways, *bad*
assembly, but I'm not (yet) an ASM stylist.
2018-04-27 16:44:37 -07:00
Elf M. Sternberg 127e5c0b71 FEAT Added subroutines to the list of skills taught in this tutorial. 2018-04-27 13:34:02 -07:00
Elf M. Sternberg 3b1f0e9a3d DOC Added license and acknowledgements 2018-04-25 21:03:02 -07:00
Elf M. Sternberg 323e46ade1 DOCS added a ton of comments for Lessons 2 and 3. 2018-04-25 20:42:39 -07:00
Elf M. Sternberg aaed91113c FEAT 32 and 64-bit SYS_WRITE calls, one by length, the other with strlen. 2018-04-25 19:40:23 -07:00
Elf M. Sternberg f1328af5d6 Working and commented. 2018-04-25 08:41:35 -07:00
Elf M. Sternberg 4a7fa5a427 Hello world (with proper exit), in 32 and 64 bit implementations. 2018-04-25 07:56:08 -07:00
Elf M. Sternberg b5503dad30 Initial commit 2018-04-25 07:55:13 -07:00