ARRAYS

XCSB supports one dimentional arrays of 8, 16 or 32 bit integer quantities and 32 bit floating point quantities. All elements of a given array are the same size however it is possible to overlay arrays of different types on top of each other.

Arrays can either exist in RAM or in program code space.

The items of an array are accessed using an index that is relative to the begining of the array. The first item is element 0 and it is 0 elements from the start of the array. The second item is element 1 and it is 1 element from the start of the array.

Copying element 0 of an array called BERT to a veriable called X is written as:

	X = BERT[0]
element 1 as:
	X = BERT[1]
element J as:
	X = BERT[J]
Copying data the other way from a variable called X to an element J of an array called BERT is written as:
	BERT[J] = X
In general any place a variable can be used a subscripted array can be used

e.g.

	x = (a + b) / c
	replace b with BERT[j] gives
	x = (a + BERT[j]) / c