[NXC] Memory Manager

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: [NXC] Memory Manager

Post by mattallen37 »

muntoo wrote:Go to Edit->Prefrences->General->Uncheck "Use MDI mode" and restart BricxCC.
...
Thank you.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: [NXC] Memory Manager

Post by nxtboyiii »

Your code compiled successfully!
Thanks, and have a nice day,
nxtboy III

programnxt.com
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: [NXC] Memory Manager

Post by muntoo »

nxtboyiii wrote:Your code compiled successfully!
OK..., but what was the result when you ran it on the NXT? I meant a NXTScreen Screenshot(s). :)
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: [NXC] Memory Manager

Post by muntoo »

Could someone please run the Attached .rxe files and provide NXT screenshots of what's displayed on the screen? Or at least say what appears? (Is it blank, does it give a runtime "Error!" (which kind?), or are there specific numbers, what are they, where are they, are they "random", etc.)

Thanks!
v0_4.zip
(29.8 KiB) Downloaded 224 times
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: [NXC] Memory Manager

Post by timpattinson »

On my NXT (efw 1.31, build 2712101703) it still says Deleting memory. I took some videos using NXTScreen and uploaded them anyway in case I'm missing something
Videos.zip
NXTScreen - shots of the four .rxes
(429.84 KiB) Downloaded 287 times
-Tim
ps. 7-Zip is awesome -and free - 39 mb to 429kb
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: [NXC] Memory Manager

Post by muntoo »

timpattinson wrote:On my NXT (efw 1.31, build 2712101703) it still says Deleting memory. I took some videos using NXTScreen and uploaded them anyway in case I'm missing something
Videos.zip
-Tim
ps. 7-Zip is awesome -and free - 39 mb to 429kb
Thanks, I'm taking a look at the NBC code generated right now... (Perhaps get John Hansen to fix the bug [in the compiler!!!].)

P.S. 7-Zip rocks, but you're bound to get such a high compression ratio if you use AVI. Try MP4, H264, and others...
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: [NXC] Memory Manager

Post by muntoo »

While I'm examining the NBC Code Listing (and doing my homework... I should get started), what does the attached .rxe do? This time, it should display at least 4 numbers.
Attachments
v0_4.zip
(25.34 KiB) Downloaded 201 times
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: [NXC] Memory Manager

Post by muntoo »

Found some the bugs* (in my code :) ). (There may be more...)

Try this.
v0_4.zip
(34.63 KiB) Downloaded 215 times
It MUST display something... anything!

* They were in MM-Demo.nxc... They were from when I wasn't sure how to implement the program, so I just put some code to help me decide how it should look like. Mind you, the new code isn't pretty (I will fix it later), but it should get the job done. ...Even if the job is done badly.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: [NXC] Memory Manager

Post by afanofosc »

muntoo wrote: (Perhaps get John Hansen to fix the bug [in the compiler!!!].)
Which bug in the compiler are you referring to here? Is it the #include problem you are having or something else?

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: [NXC] Memory Manager

Post by afanofosc »

Here's the NBC code generated by the compiler for ptr.idx++:

Code: Select all

	add __main_7qG2_ptr_7qG2_000.idx, __main_7qG2_ptr_7qG2_000.idx, __constVal1
Seems good to me.
// Report NXC Bug. Can't use "MM_ID ptr = myvar;"
I changed the code in task main to use the above construct and it compiled and generated valid code with the 1.2.1. r4. The MM_ID_CPY function also seems to generate correct code. But there is absolutely no reason to use a subroutine in this case. Just assign myvar to ptr. If that does not work correctly (i.e., mov one_struct, another_struct_of_the_same_type ) then there is a firmware defect.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest