Language GNU Assembler
Date: | 04/20/05 |
Author: | Laurent Vogel |
URL: | http://lvogel.free.fr/ |
Comments: | 2 |
Info: | n/a |
Score: | (2.84 in 116 votes) |
/* * GNU Assembler version of 99 bottles of beer * (architecture-independent as it uses assembler directives only) * Laurent Vogel http://lvogel.free.fr * * execute with: gcc -c -o /dev/null -x assembler THIS_FILE */ .macro p n,s,w .print "\n bottle\s of beer\w" .endm .macro ones a,b .ifge \a\b-2 .ifnc \a\b,99 p \a\b,s," on the wall." .print "" .endif p \a\b,s," on the wall," p \a\b,s,. .else p \a\b,," on the wall." .print "" p \a\b,," on the wall," p \a\b,,. .endif .print "Take one down, pass it around," .endm .macro tens n ones \n,9 ones \n,8 ones \n,7 ones \n,6 ones \n,5 ones \n,4 ones \n,3 ones \n,2 ones \n,1 .ifnc \n, ones \n,0 .endif .endm tens 9 tens 8 tens 7 tens 6 tens 5 tens 4 tens 3 tens 2 tens 1 tens "" p No,," on the wall."
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments
fugdabug said on 06/14/05 05:08:25
could not for all my efforts and reconfigs get this little critter to run... oh well on to the next...
Stefan Scheler said on 06/16/05 10:58:41
Fixed. Should run cleanly now.