/* Questions: * First: What does this print? * Were you right? Don't have to answer... * What is the ASCII code for a space? * Why does the loop stop? * Where did the spaces go? * Where does the newline come from? */ .section .data string: .asciz "wombat platypus wallaby" .section .text .globl _start _start: mov %esp, %ebp mov $string, %esi top: movb (%esi), %al cmpb $0, %al je out subb $32, %al movb %al, (%esi) inc %esi jmp top out: movb $10, (%esi) mov $4, %eax mov $1, %ebx mov $string, %ecx mov $24, %edx int $0x80 mov $1, %eax mov $0, %ebx int $0x80