Message board for the users of flat assembler.
> Examples and Tutorials > FPU Practice Source
This simple source attached is a minimal version of BASELIB / CPULIB focusing on FPU programming. These functions should work out-of-the box. Functions were extracted from CPU2.0 routines, and a few improvements were made to selected ones. It is intended for those who
1. Want to try out of FPU just for the sake of it
2. Want to learn FPU from the basics
3. Refresh their FPU programming skill
4. Quick check on FPU environment, floating-point binary format and similar stuff.
This source is exposing high-level side of FASMW, where extracted low-level functions (from CPULIB) were transformed into high-level self-sufficient units, with help from C library.
This source observes _fastcall calling convention on Win64. Sorry, no Linux64 version. For low-level Linux64 version, just use CPULIB. But hey, FPU is FPU no matter on what platform.
Examples, and output:
format PE64 console include 'win64axp.inc' entry main section '.data' data readable writeable y dq -10.012644 section '.text' code readable executable main sub rsp,40 finit fldpi ;Example 1 Using fpu_stack to view FPU registers call fpu_stack ;or ccall fpu_stack call prnline ;Example 2 View a double-precision format using native CALL movq xmm0,