News:

  • July 26, 2026, 05:03:33 AM

Login with username, password and session length

Author Topic: Indirect Addressing - V vs custom memory  (Read 6585 times)

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
Indirect Addressing - V vs custom memory
« on: May 31, 2019, 09:28:26 AM »
Curiosity question more than anything... why is indirect addressing restricted to just V memory? If I've created my own memory block of unsigned words why can't I use one of those instead?

CustomString[V0] works
CustomString[CustomUnsignedWord0] doesn't work

Also, why can't I use an offset in an indirect address with a string?

CustomString[V0] works
CustomString[V0-1] doesn't work

but

CustomUnsignedWord[V0] works
CustomUnsignedWord[V0+1] also works

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6168
  • Yes Pinky, Do-more will control the world!
Re: Indirect Addressing - V vs custom memory
« Reply #1 on: May 31, 2019, 10:40:35 AM »
Curiosity question more than anything... why is indirect addressing restricted to just V memory? If I've created my own memory block of unsigned words why can't I use one of those instead?

Implementation details mostly, but the simple answer is because we didn't have the extra byte to store a 2nd type.

Within the MATH box expression and output parameter fields there is no such limitation. The array index in either case can be a full expression.

CustomString[V0] works
CustomString[CustomUnsignedWord0] doesn't work

Also, why can't I use an offset in an indirect address with a string?

CustomString[V0] works
CustomString[V0-1] doesn't work

but

CustomUnsignedWord[V0] works
CustomUnsignedWord[V0+1] also works

Has nothing to do with strings, you can't do a negative displacement. The reason is related to the first answer. We had a certain number of free bits to store a displacement and chose 0 to 63 over -32 to 31.

Since you can do full expressions in MATH, of course negative is fine there.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
Re: Indirect Addressing - V vs custom memory
« Reply #2 on: May 31, 2019, 11:41:06 AM »
Makes perfect sense. Thanks Bob!