real language

Bookmarking Digg Diigo DZone Earthlink Google
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language GNU Assembler

Author:Laurent Vogel
Score: (2.84 in 116 votes)
 * GNU Assembler version of 99 bottles of beer
 * (architecture-independent as it uses assembler directives only)
 * Laurent Vogel
 * execute with: gcc -c -o /dev/null -x assembler THIS_FILE

.macro p n,s,w
.print "\n bottle\s of beer\w"

.macro ones a,b
.ifge \a\b-2
.ifnc \a\b,99
p \a\b,s," on the wall."
.print ""
p \a\b,s," on the wall,"
p \a\b,s,.
p \a\b,," on the wall."
.print ""
p \a\b,," on the wall,"
p \a\b,,.
.print "Take one down, pass it around,"

.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

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

Alternative Versions


>>  fugdabug said on 06/14/05 05:08:25

fugdabug 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

Stefan Scheler Fixed. Should run cleanly now.

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!




Security Code: