![]() |
SUB / Function Lock - 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: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14) +---- Thread: SUB / Function Lock (/showthread.php?tid=184) |
SUB / Function Lock - britlion - 03-17-2010 I think we need some word in the definition for subs and functions that makes -O2/3 NOT optimize something out of the loop because it doesn't seem to be called - but needs to be kept in, perhaps because it contains asm code that we need to keep. REQUIRED SUB Name() REQUIRED FUNCTION a(b as uInteger) as uinteger or some such? This then culminates in interesting stuff like REQUIRED SUB initialize () AS INTERRUPT <code> END SUB Re: SUB / Function Lock - boriel - 03-17-2010 I was also thinking a different approach: Tell the compiler which SUBs, FUNCs and vars it requires: Code: DIM Var1, Var2 AS uByte : REM Required vars Both solutions (yours and mine) are OK. So I think I can implement when the next release is out. |