On Wed, 4 Jan 2023 at 18:44, Berry van Sleeuwen <[email protected]>
wrote:

So to obtain the value I have:
> set #10:=substr(z,#2+(#0*#3)+1,#3)
> set #13:=c2x(substr(#10,5,1))
> set #14:=c2x(substr(#10,6,1))
> where #10 is the record in the array and #13 and #14 are the bit values. I
> can convert the value into a hex value with C2X but I can’t use C2B to
> convert it directly into a bit value.
>
> I now have a second specs stage to print the word with a X2B conversion,
> but is there a way to print the bit value directly within the first specs
> stage?
>

I am wondering whether there aren't more attractive ways to unravel your
records. You need to have the tool do the work...
When I care about some of the bits in a byte, I typically div and mod to
get an integer, and use that to index in an array of values (with the
word() function).  I guess the c2b() isn't there because we didn't expect
that would be useful in an expression. If you're just going to output it,
you could   "spec print #13 c2b " couldn't you?

Rob

Reply via email to