Hello!
I have uVision that compiles fine with the C51 v7.03 compiler and the related package, but not complete with the 8.06. I used two different Keil installations. All files are in the same folder.
In the 8.06 I get linker errors like "object does not fit in to pdata page" and "0080H". This looks like the compiler was thinking the PDATA was only 128 bytes, but it is set to 256 bytes in the startup.a51. Any clue what's different in the newer Keil package?
Also there is a warning in 8.06 (which does not show in 7.03) "converting non-pointer to pointer" on this
ptr_xdata = sPtr_obj->Adresse;
while the vars are set like this:
uchar uc_set_obj( uchar pdata *ptr_Set) { uchar i; uchar xdata *ptr_xdata; struct stOBJADR code *sPtr_obj; sPtr_obj=&Obj[*ptr_Set]; . . . ptr_xdata = sPtr_obj->Adresse; }
The struct stOBJADR has a member "uint Adresse;"
I can see no wrong use of the pointers. I just want to be sure that the warning does not affect the code to not work correctly.
"Assuming that pointers are also 16 bits..."
Note that, in general this assumption is not true for Keil C51.
In Keil C51, an unqualified pointer definition (as shown) would give a Generic Pointer - which occupies three bytes. See: http://www.keil.com/support/man/docs/c51/c51_le_genptrs.htm
Therefore, with Keil C51, the diagram should be more like:
X:100 101 102 103 104 105 106 107 108 ...+------+------+------+------+------+------+------+------+... | 986 | X:100 | X:102 | ...+------+------+------+------+------+------+------+------+... my_uint my_ptr my_ptr_ptr
Mr OP,
When I get confused with things like pointers, typecasts and functions, I always add brackets.
But ... take note of the following text from the C infrequently asked questions:
"In the old days, when Microsoft first invented C, the syntax for calling functions involved more parentheses; this was after their market research indicated that most C programmers would be coming from a Lisp environment. Later, when Kernighan took over the language design (right after AT&T bought Microsoft's language technology), he decided to eliminate the parentheses, but the old form is still allowed."
Additional brackets (parentheses) would be of no help at all in this situation, I'm afraid.
Yes. I believe the OP thinks that the "->" operator returns a pointer to the member, when it actually references the member itself ...
"Additional brackets (parentheses) would be of no help at all in this situation, I'm afraid."
Trouble is, looks like nothing helps him anyway!
Not even your nice explicit diagrammed examples!
Perhaps if a native German speaker could translate & explain his German quotation, that might throw some light...
I did, and it doesn't.
So his terminology has exactly the same flaw when expressed in German?
ie, it's a fundamental flaw, not just a problem with the translation into English?
Absolutely. Nothing was lost in translation.