.section .text .globl _start a_function: // Second question: Why does it crash if you reverse these next two instructions? mov %esp, %ebp push %ebp push $40 push $41 push $42 movl $100, (%esp) movl $20, 4(%esp) push $52 // Draw the stack here mov %ebp, %esp ret _start: mov %esp, %ebp push $800 // Remember this pushes on the instruction pointer call a_function mov $1, %eax mov $0, %ebx int $0x80