mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-10-10 00:25:06 -04:00
test: nasm-t -- Add floattest
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
26
travis/test/floattest.asm
Normal file
26
travis/test/floattest.asm
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
; nasm -O99 -f elf32 floattest.asm
|
||||||
|
; ld -m elf_i386 -o floattest floattest.o -I/lib/ld-linux.so.2 -lc
|
||||||
|
|
||||||
|
global _start
|
||||||
|
extern printf
|
||||||
|
|
||||||
|
section .text
|
||||||
|
_start:
|
||||||
|
|
||||||
|
fld qword [num1]
|
||||||
|
fadd qword [num2]
|
||||||
|
sub esp, 8
|
||||||
|
fstp qword [esp]
|
||||||
|
push fmt
|
||||||
|
call printf
|
||||||
|
add esp, 4*3
|
||||||
|
|
||||||
|
mov eax, 1
|
||||||
|
xor ebx, ebx
|
||||||
|
int 80h
|
||||||
|
|
||||||
|
section .data
|
||||||
|
num1 dq 41.5
|
||||||
|
num2 dq 0.5
|
||||||
|
|
||||||
|
fmt db "%f", 10, 0
|
||||||
12
travis/test/floattest.json
Normal file
12
travis/test/floattest.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"description": "Test float in elf32",
|
||||||
|
"id": "floattest",
|
||||||
|
"format": "elf32",
|
||||||
|
"source": "floattest.asm",
|
||||||
|
"option": "-Ox",
|
||||||
|
"target": [
|
||||||
|
{ "output": "floattest.o" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
BIN
travis/test/floattest.o.t
Normal file
BIN
travis/test/floattest.o.t
Normal file
Binary file not shown.
Reference in New Issue
Block a user