i'm not into axe, but it sound like S is only an integer (1 byte, 8 bits) zo that it can only hold one value at a time, and not an array of values.
by copying everything to S, you overflow it, and corrupt the data after the memory address of S
(that's what i think it is)