It's also note-worthy to add that the comma operator is evaluated
from left to right meaning that the printf in pinko's while loop was
evaluated first, then the expression on the right side of the comma was evaluated.
Its also note-worthy to add that EVERY expression is evaluated from left to right not just ones using the comma.
My entry. Since you never stated that it had to be done IN C:
Code:
.file "bt.c"
.version "01.01"
gcc2_compiled.:
.section .rodata
.LC0:
.string "Hello World\n"
.text
.align 4
.globl main
.type main,@function
main:
pushl %ebp
movl %esp,%ebp
subl $8,%esp
nop
.p2align 4,,7
.L3:
addl $-12,%esp
pushl $.LC0
call printf
addl $16,%esp
movl %eax,%eax
testl %eax,%eax
je .L5
jmp .L4
.p2align 4,,7
.L5:
jmp .L3
.p2align 4,,7
.L4:
.L2:
leave
ret
.Lfe1:
.size main,.Lfe1-main
.ident "GCC: (GNU) 2.95.4 20011002 (Debian prerelease)"
command line: gcc -o bt bt.s -Wall -pedantic
(btw next time make sure on the capitalization of your arguments)
No warnings nor errors.