6 int main(
int argc,
char *argv[])
10 for(
int i=0;i<1000;i++) nios_mem[i] = i;
14 printf(
"Using LOCAL_NIOS settings\n\n");
16 printf(
"Using REMOTE_NIOS setting\n\n");
24 for(
int i=5;i<15;i++) {
25 printf(
"nios[%d] = %d\n",i,(
int)nios[i]);
30 printf(
"after nios[10] = 150; nios[10] = %d\n",(
int)nios[10]);
32 printf(
"nios[5] * nios[6] : %d\n", nios[5] * nios[6]);
34 printf(
"nios[5] = nios[5] * nios[6] : %d\n", nios[5] = nios[5] * nios[6]);
36 printf(
"nios[5] = nios[5] * nios[5] : %d\n", nios[5] = nios[5] * nios[5]);
38 printf(
"\n\nBe careful to cast in any varargs function: (local_nios, fine, remote fails)\n(int)nios[6] = %d nios[6] = %d\n", (
int)nios[6], nios[6]);
42 memset(other, 0,
sizeof(other));
44 nios.copyto(7*4, other, 12);
48 for(
int i=5;i<15;i++) {
49 printf(
"nios[%d] = %d\n",i,(
int)nios[i]);
53 memset(other, 0xff,
sizeof(other));
54 nios.copyto(&nios[8], other, 4);
57 for(
int i=5;i<15;i++) {
58 printf(
"nios[%d] = %d\n",i,(
int)nios[i]);
61 nios.copyfrom(other, &nios[0], 20*4);
64 for(
int i=0;i<20;i++) {
65 printf(
"other[%d] = %d\n",i,other[i]);