tb0038.pp 1.1 KB

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