Shop OBEX P1 Docs P2 Docs Learn Events
Another Newbie Question — Parallax Forums

Another Newbie Question

I recently wanted to read a number of values into an array in PASM. So using register indirection I was able to get the values into contiguous memory locations in cog ram. Getting the value I wanted out of the array proved much harder. Am I missing something? Is there a way to get the value of a Variable that has been indirectly loaded with a value.

Storval -> Value 0
Storval+1 -> Value 1
Storval+2 -> Value 2 ( How do get the value that is stored in Storval+2 )


  • AribaAriba Posts: 2,665
    edited 2023-09-22 01:08
            mov     Value2, Storval+2

    or if you want to access it also indirect:

            mov     index, #2
            alts    index, #Storval
            mov     Value2, 0-0
  • Thanks for the reply. I was using the indirect method you listed but it looked like the value wasn't updating. I later found the error I made in another place entirely. Thanks again for your help.

  • JonnyMacJonnyMac Posts: 8,805
    edited 2023-09-26 17:35

    [deleted -- I thought this Q was about P1]

Sign In or Register to comment.