tb0038.pp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. { %CPU=i386 }
  2. { %TARGET=go32v2,win32,linux }
  3. { %NOTE=This test requires an installed Nasm }
  4. { Old file: tbs0043.pp }
  5. { shows assembler nasm output fpu opcodes problem OK 0.99.6 (PFV) }
  6. {$ifdef Unix}
  7. {$output_format nasmelf}
  8. {$endif}
  9. {$ifdef go32v2}
  10. {$output_format nasmcoff}
  11. {$endif}
  12. {$ifdef win32}
  13. {$output_format nasmwin32}
  14. {$endif}
  15. {$asmmode att}
  16. { THE OUTPUT is incorrect but the }
  17. { parsing is correct. }
  18. { under nasm output only. }
  19. { works correctly under tasm/gas }
  20. { other problems occur with other }
  21. { things in math.inc }
  22. { pp -TDOS -Ratt -Anasm bug0043.pp }
  23. procedure frac;
  24. begin
  25. asm
  26. subl $16,%esp
  27. fnstcw -4(%ebp)
  28. fwait { unknown instruction }
  29. movw -4(%ebp),%cx
  30. orw $0x0c3f,%cx
  31. movw %cx,-8(%ebp)
  32. fldcw -8(%ebp)
  33. fwait { unknown instruction }
  34. fldl 8(%ebp)
  35. frndint
  36. fsubl 8(%ebp)
  37. fabsl
  38. fclex
  39. fldcw -4(%ebp)
  40. leave
  41. ret $8
  42. end ['ECX'];
  43. end;
  44. Begin
  45. end.