Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Henryp on August 21, 2014, 02:20:14 PM

Title: Real number in DLV memory
Post by: Henryp on August 21, 2014, 02:20:14 PM
How do I show a real number using the DMD data view when the value is held in a DLV memory address? The drop down box doesn't support this as an option.
Title: Re: Real number in DLV memory
Post by: franji1 on August 21, 2014, 03:06:33 PM
Since Do-more is strongly typed, the element now dictates the "native" format.  As you know, DLV is unsigned 16 bit word.

To address issues like this, Do-more supports a concept of "casting" the element, to change the instruction or Data View's perception of the data type.

Use ":R" as a suffix on a data-block element to "cast" it to a REAL.  Note that for a REAL cast, the element MUST be DWORD-aligned, so DLV0, DLV2, DLV4 can be cast to a REAL by using DLV0:R, DLV2:R, DLV4:R.  Hence, you can not cast DLV1 as a REAL.

However, you can use PUBLISH and SUBSCRIB instructions to copy mis-aligned memory into other strongly typed memory and vice versa.

For more details on Casting, look at Do-more Designer Help Topic DMD0309.
Title: Re: Real number in DLV memory
Post by: Henryp on August 21, 2014, 06:39:05 PM
Thanks