home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1991
/
10
/
embedcp
/
test
/
mem1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-23
|
420b
|
26 lines
#include <stdio.h>
main()
{
unsigned short *p = (unsigned short *)0xc8000100;
unsigned short i,j,count = 0;
printf("Initializing memory\n");
for (i=0; i < 256; i++)
p[i] = i;
printf ("Checking memory\n");
while (1){
for (i=0; i<256; i++)
if ((j = p[i]) != i) goto error;
count++;
printf("Validated ok - %d\n",count);
}
error:
printf("Expected %d - got %d\n",i,j);
}