Code: Select all
.section .text
.globl _start
_start:
pushl $5
pushl $7
call sub
movl %eax, %ebx
movl $1, %eax
int $0x80
sub:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl 12(%ebp), %ebx
subl %ebx, %eax
movl %ebp, %esp
popl %ebp
ret
Code: Select all
.text
.globl _start
_start:
pushl $5
pushl $7
call sub
movl %eax, %ebx
movl $1, %eax
int $0x80
sub:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl 12(%ebp), %ebx
subl %ebx, %eax
movl %ebp, %esp
popl %ebp
ret