Forum
If I do a FUNCTION or SUB When is good to make it fastcall ? - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16)
+---- Thread: If I do a FUNCTION or SUB When is good to make it fastcall ? (/showthread.php?tid=880)



If I do a FUNCTION or SUB When is good to make it fastcall ? - maeloterkim - 06-01-2019

Hi

Well... this is the question Smile

If I do a FUNCTION or SUB When is good to make it fastcall ?

how can i know if ist's better as a fastcall or not?

How can i know that?

Thanks


Re: If I do a FUNCTION or SUB When is good to make it fastca - boriel - 06-02-2019

Usually when the function body is in ASM, or when you pass 0 parameters to it.
Fastcall functions are slighlty faster, but the 1st parameter comes into register and ZX Basic currently does nothing with it.
Also the Stack must be rearranged by the user on return if more than 1 parameter is used (the compiler will issue a Warning)


Re: If I do a FUNCTION or SUB When is good to make it fastca - maeloterkim - 06-02-2019

thanks