PowerBASIC 32-bit compilers pass all parameters to
By default, PowerBASIC passes parameters by reference:
Fixed-length strings, nul-terminated strings, and User-Defined Types/Unions may also be passed as BYVAL or OPTIONAL parameters, now. Try to avoid passing large items BYVAL, as itís terribly inefficient, and there is a maximum size limit of 64 Kb for a given parameter list. Arrays cannot be passed BYVAL.
PowerBASIC automatically sets up a local "stack frame" at the beginning of each Sub or Function in your program. As per standard conventions, the EBP register is used to address the parameters. The lowest parameter can be found at EBP+8, and subsequent parameters will be found in adjacent locations on the stack.
In assembler routines, it is easier and safer to access parameters by name rather than calculating their locations on the stack. However, it is important to remember the difference in accessing parameters passed by value and parameters passed by reference.
The Inline Assembler
Parameters passed by reference or by copy
Parameters passed by value
Passing dynamic strings
Accessing PowerBASIC variables by name