/*
2. Array Manipulation
*/
	#include <stdio.h>
	#include <graphics.h>
	#define LEN 20
	void  main()
	{
	  int  array1[LEN], array2[LEN], i, *a1, *a2;
	  char ch;
	  char msg[]="Copiei array1 para array2:\r\n$";
	  char *pmsg=&msg[0];
	  for( i=0; i<LEN; i++ )
	      array1[i] = i;         /*/ fill array */
	  printf("Mostre arrays: array2 deve conter lixo:\n");
	  for( i=0; i<LEN; i++ )      /* array2 contains garbage */
	    printf("\t%d \t%d \n", array1[i], array2[i] );
	  a1 = &array1[0];         /*/ set up pointers to the */
	  a2 = &array2[0];         /*/ first elements in each array  */

	  asm mov  si,a1    /* get first pointer  */
	  asm mov  di,a2    /* get second pointer */
	  asm mov  cx,LEN   /* set up count       */
	  here:
	    asm mov  ax,[si]  /* get source value   */
	    asm mov  [di],ax  /* into dest location */
	    asm add  si,2     /* increment pointers */
	    asm add  di,2
	    asm loop here
	    asm mov dx,pmsg
	    asm mov ah,09h
	    asm int 21h
	  for( i=0; i<LEN; i++ )
	    printf("\t%d \t%d \n", array1[i], array2[i] );
	}
	
