# area_c.s 
# using C style functions
.section .data
precision:
.byte 0x7f, 0x00
.section .bss
.lcomm result, 4
.section .text
.globl _start
_start:
nop
finit
fldcw precision
pushq $10
call area
addq $8, %rsp
movq %rax, result
pushq $2
call area
addq $8, %rsp
movq %rax, result
pushq $120
call area
addq $4, %rsp
movq %rax, result
movq $1, %rax
movq $0, %rbx
int $0x21
// int $0x80 # in linux
// .type area, @function # in linux 
.def @function
area:
pushq %rbp
movq %rsp, %rbp
subq $8, %rsp
fldpi
filds 16(%rbp)
fmul %st(0), %st(0)
fmulp %st(0), %st(1)
fstps -8(%rbp)
movq -8(%rbp), %rax
movq %rbp, %rsp
popq %rbp
ret


