Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SUB / Function Lock
#1
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
Reply
#2
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

SUB mysub
    ASM
    [...]
    END ASM
END SUB

ASM
[...]
END ASM (mysub, Var1, Var2) : REM Tells what this block requires

Both solutions (yours and mine) are OK. So I think I can implement when the next release is out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)