99 Bottles of Beer/Assembly: Difference between revisions

Line 727:
 
===x86_64 (GAS)===
Could maybe have done it all with macros, but I wanted to write my own itoa function. Plus I feel like using the preprocessor for its looping directives takes the challenge out of the problem. To extend to larger numbers, all you have to do is increase the size of the buffer and modify START_BOTTLES.
<lang>// Compiles with `gcc -nostdlib`
#define SYS_EXIT $60
Line 886:
counter:
.quad START_BOTTLES
numstring0buffer:
.byteascii 'x"xxx" /* Separated out because want back of string */
numstring:
.byte 'x