Blog > How do you get to an array location in the memory map?

Home Forums ViewPort How do you get to an array location in the memory map?

This topic contains 2 replies, has 2 voices, and was last updated by  Anonymous .

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10677

    Anonymous

    I’m new to this tool and must be missing something. I want to browse through the values of large arrays I might set up. I have something like the following (partial code):

    [code:1vw8mfbs]CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    var
    long arr1[500]
    long a1
    long b1
    long c1
    long d1
    long e1
    long f1
    long arr2[200]
    long arr3[300]

    obj
    vp : "Conduit"

    PUB startIt

    vp.array(@arr1,500,5)
    vp.array(@arr2,200,6)
    vp.array(@arr3,300,7)
    vp.share(@a1, @f1)

    longfill(@arr1,7,500)[/code:1vw8mfbs]

    My arr1 array shows in the watch panel as a1 and shows the first value but the address does not point to the start of the array. [b:1vw8mfbs] Is there something I need to press to get to the start of any of my arrays in the memory panel?[/b:1vw8mfbs]

    p.s. I have tried simply setting up the vp.share to span my arrays and other variables in various combinations. The tool gives me an error about the number of variables if I put in an array of size (min 100). If I only put in the array as the only variable shared then the address in the watch panel points to the beginning of the array as desired.

    #11769

    Hanno
    Keymaster

    Hi!
    This wasn’t easy in 4.73, but is in 4.74+
    Either include the array within your share statement like this:
    VAR
    long a,b,array[100],c
    PUB demo
    vp.share(@a,@c)

    or use the "vp.array" to share an array:
    VAR
    long a,b,c,array[100]
    PUB demo
    vp.array(@array,100,5)
    vp.share(@a,@c)

    Then, in the watch list you can see the first value, and you can click on the address to view the memory map with all items in array highlighted. Press "update" to update the memory map.
    Hanno

    #11770

    Anonymous

    Super. That’s just what I needed. Just getting to the start of any of my arrays is great.

    The version of ViewPort I was working with was 4.5.4 or something. That was the default download at the time. I’ve now downloaded 4.7.4 and it works fine.

    I finally learned how to use the configuration utility to name my variables. Neat stuff. Great tool.

    Now, I’ll have to buy it…

    Thanks for the help.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.