FAQ  •  Register  •  Login

SUB / Function Lock

<<

britlion

Posts: 722

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Wed Mar 17, 2010 6:19 am

SUB / Function Lock

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
<<

boriel

Site Admin

Posts: 1269

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Mar 17, 2010 8:21 am

Re: SUB / Function Lock

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.

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO