Page 15 - Prosedur
P. 15

swap:


                                                                                                                      pushl %ebp

                                                                                                                      movl %esp,%ebp                                               Set


                                                                                                                      pushl %ebx                                                   Up




        void swap(int *xp, int *yp)                                                                                    movl 12(%ebp),%ecx


        {                                                                                                              movl 8(%ebp),%edx


            int t0 = *xp;  int                                                                                         movl (%ecx),%eax                                            Body


            t1 = *yp;                                                                                                  movl (%edx),%ebx

            *xp = t1;                                                                                                  movl %eax,(%edx)


            *yp = t0;                                                                                                  movl %ebx,(%ecx)


        }

                                                                                                                       movl -4(%ebp),%ebx


                                                                                                                       movl %ebp,%esp


                                                                                                                       popl %ebp                                                 Finish

                                                                                                                       ret
   10   11   12   13   14   15   16   17   18   19   20