Page 19 of 25
Re: wishlist for NXC
Posted: 23 Feb 2012, 20:02
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?
Re: wishlist for NXC
Posted: 24 Feb 2012, 15:03
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
Re: wishlist for NXC
Posted: 24 Feb 2012, 16:40
by HaWe
I wish you a speedy recovery! :)
Re: wishlist for NXC
Posted: 25 Feb 2012, 10:18
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.
Re: wishlist for NXC
Posted: 13 Mar 2012, 02:20
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.)
Re: wishlist for NXC
Posted: 13 Mar 2012, 20:04
by HaWe
if I dare recommend to you a fantastic pharmacy drug store...
[email protected]
Re: wishlist for NXC
Posted: 14 Mar 2012, 04:05
by nxtboyiii
Is it possible to make a variable a bit? Like it is 1 or 0?
If so, could you add that?
Re: wishlist for NXC
Posted: 14 Mar 2012, 04:25
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.
Re: wishlist for NXC
Posted: 14 Mar 2012, 07:14
by spillerrec
Support for
Bit fields would actually be rather nice.
Re: wishlist for NXC
Posted: 14 Mar 2012, 10:31
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...