.text .global _start _start: subl $4,%esp # reserve four bytes on the stack for i movl $5,(%esp) # initialize i to 5 # call initInt0 # push the address of i movl %esp,%eax pushl %eax call initInt0 addl $4,%esp movl $1,%eax movl $0,%ebx int $0x80 initInt0: oldBp = 0 retaddr = oldBp + 4 ptr = retaddr + 4 pushl %ebp # to save old frame pointer movl %esp,%ebp # take a snapshot of sp # need to first get the address (value of ptr) movl ptr(%ebp),%eax # copy 0 to wherever ptr points to movl $0,(%eax) movl %ebp,%esp popl %ebp ret