Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: JeffS 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.
-
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.
-
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.
-
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. ::)
-
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)