# An example of using functions. (使用函数)
#
# 计算给定半径的圆的面积
#
.section .data
precision:
.byte 0x7f, 0x00
.section .bss
.lcomm value, 4
.section .text
.globl main
main:
nop
finit
fldcw precision
movl $10, %ebx
call area
movl $2, %ebx
call area
movl $120, %ebx
call area
movl $1, %eax
movl $0, %ebx
.type area, @function
area:
fldpi
imull %ebx, %ebx
movl %ebx, value
filds value
fmulp %st(0), %st(1)
ret
# gcc -g -o 01 01-area.s -m32
#