Hi list, i'm working with c51v750a. My problem:
int array[ 0] _at_ 0x7600; //xdata unsigned char index = 0; //xdata printf("%d", &array[ index]); printf("%d", &array[(unsigned char)(index - 1)]); //what is wrong? // Result: // 30208 --> 0x7600 (correct) // 30206 --> 0x75FE == array[ -1] incorrect, // expected array[255] @ 0x77FE
"No, C51 v7.01." ok, then i don't need test it with my older version V7.04 I will contact Keil for informations, thanks.
"I will contact Keil for informations, thanks." Please post the result when you get one.
Today i received a mail from Keil: Mr. Schneebauer wrote: "prinzipiell haben Sie Recht, daß es sich hier um einen Fehler handelt. Normalerweise versucht der Compiler das '-1' in die Konstanten zu verpacken um das Programm besser zu optimieren. Wir haben diesen Fehler nun auch behoben. Da Änderungen an zentralen Funktionen gemacht wurden, muß dieser Compiler noch ausführlich getestet werden bevor wir ihn ausliefern können." Basicly, what he writes is: Yes, its a bug. The bug is fixed and the new compiler-version will be tested. Stefan, thank you for verifying this problem.