| 1 |
;Testname=optimized; Arguments=-Ox -felf -ofloattest.o; Files=stdout stderr floattest.o |
| 2 |
|
| 3 |
; nasm -O99 -f elf32 floattest.asm |
| 4 |
; ld -m elf_i386 -o floattest floattest.o -I/lib/ld-linux.so.2 -lc |
| 5 |
|
| 6 |
global _start |
| 7 |
extern printf |
| 8 |
|
| 9 |
section .text |
| 10 |
_start: |
| 11 |
|
| 12 |
fld qword [num1] |
| 13 |
fadd qword [num2] |
| 14 |
sub esp, 8 |
| 15 |
fstp qword [esp] |
| 16 |
push fmt |
| 17 |
call printf |
| 18 |
add esp, 4*3 |
| 19 |
|
| 20 |
mov eax, 1 |
| 21 |
xor ebx, ebx |
| 22 |
int 80h |
| 23 |
|
| 24 |
section .data |
| 25 |
num1 dq 41.5 |
| 26 |
num2 dq 0.5 |
| 27 |
|
| 28 |
fmt db "%f", 10, 0 |