
   ...
   ...
DSEG  AT     030H     ;setup data area
IDX   DS     1        ;index for array 
ARY   Ds     10       ;array of 10 bytes
   ...
   ...
   ...
CSEG  AT     040H     ;part of code area for the sample
;
INIT:                 ;loop to initialize the array 
      MOV    IDX, #0  ;initialize the array index
;
      MOV    R2,#10   ;setup loop counter for array
ILOOP:
      MOV    A, IDX   ;make pointer to next element
      ADD    A, #ARY
      MOV    R0, A    ;put pointer into R0
      MOV    @R0, IDX ;set element equal to index value
                      ;(just as an example)
      INC    IDX      ;increment the index
      DEC    R2       ;decrement the loop counter
      JNZ    ILOOP    ;loop through size of array
;
    ...
    ...
