.pos 0 main: irmovl stack,%esp # init de la pile irmovl b,%eax pushl %eax # empiler &b irmovl a,%eax pushl %eax # empiler &a call swap iaddl 8,%esp # depiler halt swap: mrmovl 4(%esp),%eax # param pa=&a mrmovl 8(%esp),%ebx # param pb=&b mrmovl (%eax),%ecx # valeur a=*pa mrmovl (%ebx),%edx # valeur b=*pb rmmovl %ecx,(%ebx) # swap *pb = a rmmovl %edx,(%eax) # swap *pa = b ret .pos 0x100 a: .long 1 b: .long 2 .pos 0x200 stack: