Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: ATU on March 28, 2019, 03:29:34 PM

Title: 2 dimensional arrays in 2.5
Post by: ATU on March 28, 2019, 03:29:34 PM
I see you've added this feature in Math boxes. Before you were limited to 64 for the offset for 2 dim, for use anywhere in the program. So now you can do the full 16 bit range in both dimensions, but only in the Math box?  Do they have to be Vmem locations or can you use UDTs?
Title: Re: 2 dimensional arrays in 2.5
Post by: BobO on March 28, 2019, 03:32:34 PM
I see you've added this feature in Math boxes. Before you were limited to 64 for the offset for 2 dim, for use anywhere in the program. So now you can do the full 16 bit range in both dimensions, but only in the Math box?  Do they have to be Vmem locations or can you use UDTs?

This isn't new. It's not really multi-dimension, it's just allowing a full expression between the brackets. There are no practical limits to the expression. Works in the MATH output field too.
Title: Re: 2 dimensional arrays in 2.5
Post by: ATU on March 28, 2019, 03:39:36 PM
So the offset can now be a variable or expression in Math boxes only, but is the second index still limited to a value of 63 or can it be larger?
Title: Re: 2 dimensional arrays in 2.5
Post by: BobO on March 28, 2019, 03:41:19 PM
So the offset can now be a variable or expression in Math boxes only, but is the second index still limited to a value of 63 or can it be larger?

No...everything between the brackets is an expression. D[V0 + 10 * sqrt(pi()) - 12.3 / R13] is a valid array index.
Title: Re: 2 dimensional arrays in 2.5
Post by: BobO on March 28, 2019, 03:45:13 PM
That's why I've said we can support N dimension arrays. D[A*ASize + B*BSize + C*CSize + D] is a not perfect, but manageable, replacement for D[A][ B][C][D]. The MATH output parameter can do it too.
Title: Re: 2 dimensional arrays in 2.5
Post by: ATU on March 28, 2019, 03:50:45 PM
That could be very useful. Thanks for the example.
Title: Re: 2 dimensional arrays in 2.5
Post by: Controls Guy on April 05, 2019, 12:40:39 PM
The thing that goes with this that can be kind of cool is that the MATH expression is allowed to be a constant.  SO, you can use it as a SET/RESET for a register with a full expression as the pointer.

Turn the thing on it's head, in otherwords.