swap2.s
contents ::
  loop.c
  loop.s
  main_swap.c
  quick_sort.s
  ss.s
  swap2.c
  swap2.s
  swap_ararym.c
  swap_array.c
  swap_array.s
  swap.c
  swap.s

# void swap(){
#  int temp;
#  int a=1;
#  int b=0;

#  temp=a;
#  a=b;
#  b=temp;

#}
.data
.LC1:
         .string         "a: %d\tb: %d\n"
.text
.globl swap2
swap2:
         pushl         %ebp
         movl         %esp, %ebp
         subl         $12, %esp
         
         #  int a=1;
         movl         $1, -8(%ebp)         
         
         #  int b=0;
         movl         $0, -12(%ebp)
         
         pushl         -12(%ebp)
         pushl         -8(%ebp)
         pushl         $.LC1
         call         printf         
         
         #  temp=a;
         movl         -8(%ebp), %eax
         xchg         -12(%ebp), %eax
         movl          %eax, -8(%ebp)
         
         
         pushl         -12(%ebp)
         pushl         -8(%ebp)
         pushl         $.LC1
         call         printf
         leave
         ret

James Little