Byte array question
Let's say that I have an array that is 23 bytes long defined in the CON section as:
and in the DAT section I have some data defined as:
some_array_2 byte $02,$00,$01,$05,$02,$00,$07,$01,$02,$05,$14,$14
The array in the CON section needs to be 23 bytes long as sometimes there may be some data that is 23 bytes long but not always.
If I wanted to preload the array from the DAT section to the array in the CON section I would use:
bytemove(@some_array_1, @some_array_2, 23)
But when I do this:
repeat idx from 0 to 23
I get data that is beyond the array from the DAT section because that is only 12 bytes long. I only use this 12 byte example because that is the length of some byte array that I might receive but I don't know that it is only 12 bytes long.
Is there a way to know how long a byte array is without looking for a 0 terminator because in this case there is no 0 at the end of the byte array in the DAT section it is some random data from memory I'm guessing.
If I wanted to preload the data into the longer byte array is there a better way than bytemove? Some way to pad the empty places with 0?