Staz Software
HomeFutureBasicSharewareOrderContact

Tech Notes

Forcing Registers for Floating Point Math

Generally speaking, single and double precision variables are stored in memory. But when you need a bit of extra speed, you can ask FutureBASIC to store those items in floating point registers. Then instead of moving a variable from memory to a register, performing an operation, and moving it back, the operation is simply performed on the register variable. Two steps are saved.

All you need to do is change the way you dimension the floats. Those dimensioned before a local function name will be in registers. Those that come after the name will be in memory.

Local
Dim as double regFloat1 , regFloat2          <---- in registers
Local Fn myCoolThinker ( Param1 as long , Param2 as Double )

 Dim as double memFloat1 , memFloat2      <---- in memory
 Dim as long result 
 
 // function code here
 
End Fn = result

FutureBASIC

Demo

Order

Tour

Tech Notes

FAQ

Sample Code

Web Sites

Mailing List

System
Requirements

blank