addr_size = 4 int32_size = 4 .data message: .asciz "Hello, World!\n" .text .global _start _start: pushl $5 pushl $7 pushl $message call sub1 addl $12,%esp movl $0,%ebx movl $1,%eax int $0x80 sub1: oldBP = 0 retAddr = oldBP + 4 pMess = retAddr + addr_size start = pMess + addr_size start_size = int32_size len = start + start_size pushl %ebp movl %esp,%ebp # snapshot of SP as frame pointer # need to computer pMess + start, and put the sum # into ecx movl pMess(%ebp),%ecx # ecx becomes a pointer to the message addl start(%ebp),%ecx # ecx becomes the sum of message address and start movl len(%ebp),%edx movl $1,%ebx movl $4,%eax int $0x80 popl %ebp ret