|
@@ -11,8 +11,16 @@
|
|
|
The ATT read
|
|
|
fdiv %st,%st(1)
|
|
|
as
|
|
|
- st(1):=st/st(1) }
|
|
|
-
|
|
|
+ st(1):=st/st(1)
|
|
|
+ Should be tested with
|
|
|
+ different output styles :
|
|
|
+ for go32v2
|
|
|
+ -Aas -Acoff and -Anasmcoff
|
|
|
+ for win32
|
|
|
+ -Aas -Apecoff and -Anasmwin32
|
|
|
+ for linux
|
|
|
+ -Aas and -Anasmelf
|
|
|
+ }
|
|
|
|
|
|
program test_nasm_div;
|
|
|
|
|
@@ -46,6 +54,15 @@ begin
|
|
|
Writeln('ATT result of 4/2=',z:0:2);
|
|
|
if z <> 2.0 then
|
|
|
Halt(1);
|
|
|
+ asm
|
|
|
+ fldl y
|
|
|
+ fldl x
|
|
|
+ fadd
|
|
|
+ fstpl z
|
|
|
+ end;
|
|
|
+ Writeln('ATT result of 4+2=',z:0:2);
|
|
|
+ if z <> 6.0 then
|
|
|
+ Halt(1);
|
|
|
{$asmmode intel}
|
|
|
asm
|
|
|
fld x
|
|
@@ -66,5 +83,16 @@ begin
|
|
|
Writeln('Intel result of 4/2=',z:0:2);
|
|
|
if z <> 2.0 then
|
|
|
Halt(1);
|
|
|
+ asm
|
|
|
+ fld y
|
|
|
+ fld x
|
|
|
+ fadd
|
|
|
+ fstp z
|
|
|
+ end;
|
|
|
+ Writeln('Intel result of 4+2=',z:0:2);
|
|
|
+ if z <> 6.0 then
|
|
|
+ Halt(1);
|
|
|
+
|
|
|
Writeln('All tests completed successfully!');
|
|
|
-end.
|
|
|
+end.
|
|
|
+
|