# An example of the FCOMI instruction
#
# 浮点数比较
#
#
.section .data
value1:
.float 10.923
value2:
.float 4.5532
.section .text
.globl main
main:
nop
flds value2
flds value1
fcomi %st(1), %st(0)
ja greater
jb lessthan
movl $1, %eax
movl $0, %ebx
int $0x80
greater:
movl $1, %eax
movl $2, %ebx
int $0x80
lessthan:
movl $1, %eax
movl $1, %ebx
int $0x80
# gcc -g -o 13 13-fcomi.s -m32
#
# ./13
# echo $?
# 2