I don't have a working compiler handy currently, but I imagine that the problem could be lack of support for dynamic arrays, pointers being initialized to flash storage, or the program not crashing because you don't have a working heapmgr when the arrays are allocated (if they are allocated). Either way, a bug for sure
Much more trivial: one part of the compiler assumes that the
High value stored in the array is 8-bit the other part assumes 16-bit and that obviously doesn't go hand in hand that well.
![Wink ;)](/Smileys/ExcellentSmileys1/wink.gif)
(in this case only the high part of the 16-bit High value is loaded which is 0 and thus
High returns
0 and
Length returns
1)
Regarding the state of dynamic arrays on AVR in general:
The functions that are used for dynamically allocating a dynamic array are disabled by default on AVR (e.g.
SetLength), however these can be enabled by compiling the RTL with a suitable configuration as well as providing the tiny heap.
The
Length and
High however are intrinsics that are not handled by the RTL, but by the compiler itself and thus are available always just like the ability to declare a dynamic array is always available.
Declaring constants might be one of the few uses dynamic arrays have on AVR, though you'll always have 8-Byte overhead for each constant declared such compared to a static array of the same size (2 Byte reference count, 2 Byte size and 2 Byte Pointer to the array data).