wishlist for NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
pepijndevos
Posts: 175
Joined: 28 Dec 2011, 13:07
Location: Gelderland, Netherlands
Contact:

Re: wishlist for NXC

Post by pepijndevos »

John, I'm looking at the SVN log for the compiler to determine of you by any chance implemented the varjump opcode already. I some places it says "Lots of stuff", so I can't exactly tell.

If you did, thanks a lot. If you did not, is there anything I can do to help?
-- Pepijn
http://studl.es Mindstorms Building Instructions
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: wishlist for NXC

Post by afanofosc »

I haven't checked in my changes, iirc, for the new opcodes. I am trying to figure out what I did wrong in the firmware that causes it to crash when I try to use the opcode. It is hard to know whether the problem is in the compiler or the firmware. Swamped at work, sick for a couple weeks. It's all combined to slow my NXT development progress.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

I wish you a speedy recovery! :)
pepijndevos
Posts: 175
Joined: 28 Dec 2011, 13:07
Location: Gelderland, Netherlands
Contact:

Re: wishlist for NXC

Post by pepijndevos »

doc-helmut wrote:I wish you a speedy recovery! :)
Me too.

Does any specific opcode make it crash? The absolute jump sounds like a good candidate for weird stuff happening, the others seem straightforward to me, but then I have no real expertise on the matter.
-- Pepijn
http://studl.es Mindstorms Building Instructions
mcsummation
Posts: 220
Joined: 23 Jan 2012, 17:07
Location: Round Rock, TX

Re: wishlist for NXC

Post by mcsummation »

Re: https://sourceforge.net/apps/phpbb/mind ... ine#p12596

It appears to me that the compiler generates really unique name space prefixes as it munches down through some NXC code, possibly unique for each macro (which is what the INLINE would be called in other, older languages). How about allowing the % character at the beginning of a variable name used in an INLINE function to generate a unique prefix? That way we could have INLINE functions with private variable space.

When I ran into this a couple of weeks ago, before I understood that INLINE code really can't have local variables, the compiler was not only generating line numbers globally through all the included libraries, the errors I was getting made no sense whatsoever, at least to my feeble brain.


I don't know what I was seeing. It doesn't do it now. But, then again, I've updated to a new version of BricxCC. I'm going to claim that the gremlin that was counting line numbers from the very beginning and so I couldn't figure out where in my code my idiot mistakes were located was the same gremlin doing this. Please ignore my drug induced ramblings. (Yes, I've got a sinus infection and I don't really know what effect it has when I mix all my normal "old man" drugs with the new stuff.)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

if I dare recommend to you a fantastic pharmacy drug store... [email protected]
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: wishlist for NXC

Post by nxtboyiii »

Is it possible to make a variable a bit? Like it is 1 or 0?
If so, could you add that?
Thanks, and have a nice day,
nxtboy III

programnxt.com
mcsummation
Posts: 220
Joined: 23 Jan 2012, 17:07
Location: Round Rock, TX

Re: wishlist for NXC

Post by mcsummation »

nxtboyiii wrote:Is it possible to make a variable a bit? Like it is 1 or 0?
If so, could you add that?
I doubt that NXC will let you define a 1 bit variable. The smallest "normal" variable is a byte (8 bits). However, when building an I/O (or storage buffer), you can mash them together. I did a database many years ago where disk space was expensive and I packed variables based on the number of bits that could actually be used. So, for instance, dates were packed: month took 4 bits, day of month took 5 bits, etc. Boolean flags took only 1 bit. You can store a lot of data in a small space when you do that. I've got 30 years worth of checkbook entries packed into 445KB.
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: wishlist for NXC

Post by spillerrec »

Support for Bit fields would actually be rather nice.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
pepijndevos
Posts: 175
Joined: 28 Dec 2011, 13:07
Location: Gelderland, Netherlands
Contact:

Re: wishlist for NXC

Post by pepijndevos »

As ar as I know, the data space is byte-alligned. So even if you made a bit, the next 7 bits would be unused. Maybe if you defined 8 bits in a row...
-- Pepijn
http://studl.es Mindstorms Building Instructions
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests