Logo GNU
Kodovani P°edchozφ Nßsledujφcφ Obsah

36. Assembler z GCC ve floating point verzi

        .file   "formulas.c"
gcc2_compiled.:
___gnu_compiled_c:
.data
        .align 2
_maxiter:
        .long 10000000
.text
LC0:
        .ascii "Mloops:%f\0"
        .align 2
LC1:
        .long 0x0,0x80000000,0x4001
        .align 2
LC2:
        .long 0x0,0x4056c000
        .align 4
.globl _main
_main:
        pushl %esi
        pushl %ebx
        call ___main
        call _clock
        movl %eax,%esi
        fldz
        fldz
        movl _maxiter,%ebx
        fldz
        fldz
        testl %ebx,%ebx
        je L22
        fldt LC1
        jmp L20
        .align 4,0x90
L24:
        fxch %st(2)
        fxch %st(4)
L20:
        fxch %st(4)
        faddp %st,%st(3)
        fxch %st(2)
        fcomp %st(3)
        fnstsw %ax
        andb $5,%ah
        je L23
        fld %st(1)
        fmul %st(2),%st
        fxch %st(2)
        fmul %st(1),%st
        fld %st(0)
        faddp %st,%st(1)
        fld %st(1)
        fmulp %st,%st(2)
        fld %st(1)
        fsub %st(3),%st
        decl %ebx
        jne L24
        fstp %st(0)
L22:
        fstp %st(0)
L23:
        fstp %st(0)
        fstp %st(0)
        fstp %st(0)
        movl _maxiter,%edx
        subl %ebx,%edx
        movl %edx,%ebx
        call _clock
        subl %esi,%eax
        pushl %eax
        fildl (%esp)
        addl $4,%esp
        fidivrl _maxiter
        fldl LC2
        fmulp %st,%st(1)
        subl $8,%esp
        fstpl (%esp)
        pushl $LC0
        call _printf
        movl %ebx,%eax
        addl $12,%esp
        popl %ebx
        popl %esi
        ret


P°edchozφ Nßsledujφcφ Obsah

Dotazy a p°ipomφnky ohledn∞ strßnky posφlejte na hubicka@paru.cas.cz