Subject:
|
Re: Scout memory map and variable extraction
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sat, 4 Dec 1999 15:55:21 GMT
|
Viewed:
|
601 times
|
| |
| |
Bert ,
If you add your offset then we agree!
I was looking at your memmap.dat (I opened in Notepad).
I had said hex 233 for the pointer to the start of the first subroutine. To
translate this to your memory map: 0x233 - 0x40 + 1 = 0X1F4 which is 500 in
decimal. That agrees with you.
The address at 500 is 0x249. Converting this to your system we get
0x249-0x3f=0x20a = 522. Now, looking at your web page we see your program
dump starting at 522. The first three bytes there are 0xF6. These are the
"return" byte codes for the first 3 subroutines, then the first task starts
at 525. Converting this back to my style dump, we get 525+0x3f=0x24c. And
finally, if you look at the pointer for the first task at 507 in your dump,
you see it points to 0x24c.
As far as the variables go, you have them starting at 376 which if we
convert it, we get 376 + 0x3f = 0x1B7. That's what we find in Scoutdef.h.
(By the way, I figured most of it out the hard way too. THEN, I found it in
Scoutdef.h).
Wow, that's pretty confusing. You may want to start your memory dumps at
0x40 or 64 decimal. If you do that, the program pointers might make more
sense. And you will want to use the pointers to find the program. If you add
some subroutines, the first task will move up in memory.
Its good to see some activity in this area of lugnet lately. Looking foward
to seeing what you and others contribute.
--Mike Kory
Bert van Dam <bvandam@westbrabant.net> wrote in message
news:005301bf3e69$ebf8c2e0$9ee6acc1@van-dam...
> Hi Mike,
>
> Yes I do like decimal, is it that obvious :))
>
> Pollm's legal range starts at 0x0040, and I used that as 1 in my memory
> count. But even if I take that offset in account your results still differ
> from mine. I think it's more a definition problem than something else
> because I am able (using my numbers) to extract values for the variables.
>
>
> I'll take a closer look at the Scoutdef.h files (much easier, I did it the
> hard way be retreiving all memory and analysing it...).
>
> I'm very interesting in your results!
>
> CU Bert
>
> Lego robots and artificial intelligence www.bvandam.net
>
> > -----Oorspronkelijk bericht-----
> > Van: Mike Kory <kory@advancenet.net>
> > Aan: lugnet.robotics.scout@lugnet.com <lugnet.robotics.scout@lugnet.com>;
> > lugnet.robotics@lugnet.com <lugnet.robotics@lugnet.com>
> > Datum: zaterdag 4 december 1999 1:46
> > Onderwerp: Re: Scout memory map and variable extraction
> >
> >
> > > Hi Bert,
> > > I plan on doing a memory map on my site soon. Maybe this weekend. What I had
> > > found earlier is different than what you've found. I'll have to look into
> > > this some more.
> > > My findings (in Hex--sorry I know you like decimal):
> > >
> > > 233 2 bytes, a pointer to the start of sub 1
> > > 235 sub 2
> > > 237 sub 3
> > > 239 task 1
> > > 23b task 2
> > > 23d task 3
> > > 23f task 4
> > > 241 task 4
> > > 243 task 5
> > >
> > > by the way all subroutines end with the F6 byte code.
> > >
> > > Also, if you look in Scoutdef.h you can see the address of various variable
> > > and things.
> > > For example: (again in hex:)
> > > The state of the touch sensor 1 (T1) is at 12E.
> > > T2 is at 12F.
> > > Light sensor is 130.
> > > The raw value for T1 is at 134 (2 bytes), T2 at 136 and the light sensor at
> > > 138.
> > > The battery level is at 13A, multiply this value by .109 to get the voltage.
> > >
> > > Global variables are from 1B7 to 1CA (2 bytes each).
> > > The counters are at 22b and 22D
> > > The message "mail box" is at 96.
> > >
> > > The state of the motors A,B and "C" are at: 144,145,146
> > >
> > > Again, I'll double check things and get some examples of downloading code
> > to
> > > the Scout and stuff like that soon.
> > >
> > > Mike
> > >
> > >
> > >
> > >
> > > Bert van Dam <bvandam@westbrabant.net> wrote in message
> > > news:005701bf3ddd$2ced9e20$bde7acc1@van-dam...
> > > > To allow for easier debugging of the Scout I've written a program (in Quick
> > > > Basic) that retreives variables from the Scout while it is running a
> > > > program. The variables (listed 0 -16) are displayed on the PC screen and
> > > > refreshed a the touch of the space bar.
> > > >
> > > > If you're interested in in the section Scout/MemoryMap on my site.
> > > >
> > > > CU Bert
> > > >
> > > >
> > > >
> > > > Lego robots and artificial intelligence www.bvandam.net
> > > >
> > > >
> >
>
|
|
Message is in Reply To:
| | Re: Scout memory map and variable extraction
|
| Hi Mike, Yes I do like decimal, is it that obvious :)) Pollm's legal range starts at 0x0040, and I used that as 1 in my memory count. But even if I take that offset in account your results still differ from mine. I think it's more a definition (...) (25 years ago, 4-Dec-99, to lugnet.robotics)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|