News:

  • October 09, 2026, 04:37:58 AM

Login with username, password and session length

Author Topic: Pointers & DLV memory  (Read 7583 times)

JeffS

  • Hero Member
  • *****
  • Posts: 113
Pointers & DLV memory
« on: July 20, 2020, 07:06:06 PM »
So if I wanted to reference a DLV[v1] how do I do it?  The value stored in V1 is always interpreted as a decimal so I end up with references that don't exist in the octal memory index.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Pointers & DLV memory
« Reply #1 on: July 21, 2020, 08:08:03 AM »
So if I wanted to reference a DLV[v1] how do I do it?  The value stored in V1 is always interpreted as a decimal so I end up with references that don't exist in the octal memory index.

It?s just an index. Convert the octal DLV number to decimal to figure out what the V1 value should be. Octal 12 is equal to decimal 10, so the index would be 10 to access DLV12.
"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

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Pointers & DLV memory
« Reply #2 on: July 21, 2020, 08:55:52 AM »
You can use octal constants (leading 0 on the digit):

MOVE 017 V10
MATH V11 "V10 * 0100"

Also, Data View supports octal format, both for display and editing.

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: Pointers & DLV memory
« Reply #3 on: July 21, 2020, 09:17:53 AM »
OK, so I don't know what was different and why it wasn't working earlier.  Messed with it again after removing some of my work arounds and it just worked.  Some form of user error I am sure.   ::)
« Last Edit: July 21, 2020, 09:40:51 AM by JeffS »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Pointers & DLV memory
« Reply #4 on: July 21, 2020, 10:06:19 AM »
Realize at the lowest level, it's all binary.  I can display the binary pattern 0x31 differently.

In decimal, it's the value 49
In hexadecimal, it's the value 31 (0x31 in C/C++/Java/Do-more)
In octal, it's the value 61 (061 in C/C++/Java/Do-more)
In ASCII, its the character of the digit '1'
In IEEE Floating Point it's (who knows), but say 1.234E-012

So, if you need the octal number 2000 (e.g. as a pointer to DLV2000), just enter it as 02000 (note the leading 0).  There are no 8's and 9's.  Just like DL, the memory location after DLV7 is DLV10.  There is no hidden DLV8/DLV9.  It's all binary at the microprocessor level, it's just how we human's view the binary pattern 8 (in decimal, it's 8.  In octal, it's 10.  In binary it's 100, in base 5 it's 13), but the microprocessor just view the binary address as the one after 7 and two less than 10 (decimal, or 012 octal, or 0x0A hexadecimal  ;D)