This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

help

look at the code. it is function for testing memory but says memory is bad
but the memory is new.
what is wrong

<code>
void MemoryDisplay(void) { unsigned char *Address; unsigned char a,data,temp; char DisBuf[60]; int k,Counter,KeypadType; unsigned long int A;

strcpy(DisBuf,"Enter Address "); disp(DisBuf);

A=0; Counter=0;

while ( (k=getkey()) != ENTER) { if ( k != 255 && k < 0x3A && k>0x2F ) { A = (A*10)+(k & 0x0F); DisBuf[20+Counter] = k; disp(DisBuf); Counter++; } }

Address = (unsigned char *) A;

do { strcpy(DisBuf," "); Counter=0; while (Counter<7) { data = *Address; a = data/16; if (a>9) a=a+7; DisBuf[(Counter*3)] = a+0x30; a = data%16; if (a>9) a=a+7; DisBuf[(Counter*3)+1] = a+0x30; if ( (data>31) && (data<123) ) DisBuf[(Counter*3)+20] = data; else DisBuf[(Counter*3)+20] = ' '; if (Counter != 6) DisBuf[(Counter*3)+2] = ' '; DisBuf[(Counter*3)+21] = ' '; DisBuf[(Counter*3)+22] = ' '; Counter++; Address++; }

disp(DisBuf); k = 0; while ( (k != F1) && (k != F2) ) k = getkey(); } while (k == F1); }