I use assembly language to call the C language function.And I have a problem.
main.s
Code:
.section .data
a:
.int 10
b:
.int 20
.section .text
.globl main
.type main,@function
main:
movl $a,%eax
movl $b,%ebx
pushl %ebx
pushl %eax
call _swapint
movl $1,%eax
movl $0,%ebx
int $0x80
pro.c
Code:
#include<stdio.h>
int _swapint(int *a,int *b)
{
int c;
printf("!!!");
c=*a;
*a=*b;
*b=c;
printf("success!");
return 0;
}
I am sure that the value of a and b have been swapped,but I can't see any output! I can't understand.
thx.