Function Call Stratergy

XCSB allows three different call strateries for user defined functions. These are The long call stratergy is the normal (prefered) stratergy used by XCSB. Using this stratergy XCSB is able to overcome the PIC hardware stack restrictions and also implement multitasking.

The fast call stratergy greatly reduces the call / return overhead imposed by the long call stratergy on very small very frequently invoked user function.

The inline stratergy allows XCSB to tailor functions for each explicit invokation. In some cases it is possible to reduces the size of the generated executable by invoking a medium sized function multiple times inline. The inline stratergy works best when applied to user functions that are very small OR use references to arrays as parameters OR are invoked with constants as parameters.

Using the long call stratergy to invoke a function

This is the default stratergy so just declaring the function as a normal function will ensure that it is invoked using the long call stratergy

Using the fast call stratergy to invoke a function

Simply insert the keyword fastcall after the keyword proc in the function declaration will ensure that it is invoked using the fast call stratergy

Using the inline stratergy to invoke a function

Simply insert the keyword inline after the keyword proc in the function declaration will ensure that it is invoked using the inline stratergy
	e.g.
		proc fred1()
			// long call stratergy used for function fred1
		endproc


		proc fastcall fred2()
			// fast call stratergy used for function fred2
		endproc


		proc inline fred3()
			// inline stratergy used for function fred3
		endproc