.pos 0 main: irmovl stack,%esp mrmovl n,%eax pushl %eax # empiler param n call f iaddl 4,%esp # depiler param rmmovl %eax,res # resultat dans %eax halt f: mrmovl 4(%esp),%ecx # param n andl %ecx,%ecx # eval condition code je f0 # si n = 0 ? fn: isubl 1,%ecx # n-1 pushl %ecx # empiler param n-1 call f # retour dans %eax iaddl 4,%esp # depiler param mrmovl 4(%esp),%ecx # restore param n addl %ecx,%eax # retour dans %eax = n + f(n-1) ret f0: irmovl 0,%eax ret # valeur de retour dans %eax end: halt .pos 0x100 n: .long 10 res: .long 0 # res = 55 = 0x37 .pos 0x200 stack: