Call a foreign-language function: Difference between revisions

Content added Content deleted
Line 353: Line 353:
Lastly, there are at least two methods in FBSL to call machine code routines given their entry points:
Lastly, there are at least two methods in FBSL to call machine code routines given their entry points:
<pre>CALLABSOLUTE(ByteBuffer[, parm1[, parm2[, parm3[, parm4]]]]) ' ByteBuffer stores machine code bytes; works as a Sub
<pre>CALLABSOLUTE(ByteBuffer[, parm1[, parm2[, parm3[, parm4]]]]) ' ByteBuffer stores machine code bytes; works as a Sub
FUNCALL(AddrOfEntryPoint[, parameters...) ' works as either a Sub or Function</pre>
FUNCALL(AddrOfEntryPoint[, parameters...]) ' works as either a Sub or Function</pre>


All function calls support Integer, Quad, Single, or Double parameters and returns. FBSL features a built-in stack balancing mechanism which eliminates stack corruption irrespective of whether the API calls are using STDCALL or CDECL calling conventions. Please note that FBSL '''does not''' make use of forward function declarations or header files.
All function calls support Integer, Quad, Single, or Double parameters and returns. FBSL features a built-in stack balancing mechanism which eliminates stack corruption irrespective of whether the API calls are using STDCALL or CDECL calling conventions. Please note that FBSL '''does not''' make use of forward function declarations or header files.