void error(void){
#ifndef _PROMIC
  while (1) {};
#else
  asm(iem r0);
#endif
}

void copy_array(int *from, int *into, int size)
{
  int i;
  
  for(i = 0; i < size; i++)
    {
      *into = *from;
      into++;
      from++;
    }
}

void offset(int *tab, int size, int offset)
{
  int i;

  for(i = 0; i < size; i++)
    {
      *tab += offset;  /* -=, <<=, =>> can be used too */ 
      tab++;
    }
}

int main(void)
{
  int z[5] = {5,4,3,2,1};
  int y[5];
  int w = 2;

  /* copy a memory area in another */
  copy_array(&z[0], &y[0],5);  

  if ((z[3] != y[3]) && (y[3] != 2)) error();
  
  /* apply an offset on a value group */
  offset(&y[0],5,w);
}
