To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 621
620  |  622
Subject: 
Syntax for reserving variables in NQC?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 28 May 2000 21:50:22 GMT
Viewed: 
2012 times
  
The fact that in RCX2 the counters are overlapped with global variables
has brought about an interesting problem.  How should a programmer
indicate to the NQC compiler that a certain RCX variable location is to
be left untouched (not assigned to any NQC globa/local/temp variable)?

What should the synatx be?  The only thing even remotely close to this
in normal C/C++ is the ability to specify certain registers for function
arguments in support of inline assembly, or interfacing to OS glue.

At present I'm leaning more towards a #pragma rather than introducing
another keyword into the language...

// reserve RCX variable location 1
#pragma reserve 1

How does this sound?  Would people prefer a language construct for this
(and if so, what should it be)?

Dave Baum


p.s.  I realize that in theory NQC could automatically determine counter
usage and reserve the locations on behalf of the programmer.  Perhaps
I'll add that functionality eventually.  But the idea of reserving a
specific location has merit on its own, so I see this as a general
purpose solution to the counter problem.

--
reply to: dbaum at enteract dot com



Message has 2 Replies:
  Re: Syntax for reserving variables in NQC?
 
Dave Baum schreef: (...) It looks perfectly logical to me. Will it be possible to reserve a range or do we need to reserve each location separately? No need for an extra keyword indeed. (It's hard enough already. Well I guess part of that comes from (...) (25 years ago, 28-May-00, to lugnet.robotics.rcx.nqc)
  Re: Syntax for reserving variables in NQC?
 
Although I would much prefer to see NQC reserveing the variables for itself, I prefer the syntax with a start and end on it. #pragma reserve 1 3 James P (24 years ago, 29-May-00, to lugnet.robotics.rcx.nqc)

8 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR