Logic for circular addressing providing increased compatibility with higher-level
programming languages accesses a base pointer pointing to a first element of an
array including a number of elements each including an address. The first element
of the array includes an address less than the address of every other element of
the array. The logic accesses a base-pointer offset, adds the base-pointer offset
to the base pointer to calculate an address of a current element of the array,
and stores the calculated address for subsequent access by one or more operations.
After the current element has been accessed by the one or more operations, the
logic increments the base-pointer offset by one, accesses a maximum offset value
equal to the number of elements of the array, and compares the incremented base-pointer
offset with the maximum offset value. If the incremented base-point offset is less
than the maximum offset value, the logic stores the incremented base-pointer offset.
If the incremented base-pointer offset is equal to the maximum offset value, the
logic sets the base-pointer offset to zero and stores the set base-pointer offset.