/* 2. Array Manipulation */ #include #include void main() { int array1[64], array2[64], i, *a1, *a2; char ch; char msg[]="Copiando array1 para array2:\r\n$"; char *pmsg=&msg[0]; for( i=0; i<64; i++ ) array1[i] = i; /*/ fill array */ 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,64d /* 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<20; i++ ) printf("\t%d \t%d \n", array1[i], array2[i] ); }