xdata is a modifier, so I'm not sure if you can do both.. You probably can..
The compilers parser will see the modifier and the linker will allocate the character pointer accordingly.
As it isn't ANSI C then without the documentation, I don't know...
I know, I don't know either... All I know is with data modifiers on the pic... The modifier can be place anywhere in the declaration.... The only two "close" declarations in SDCC were those two...
Kinda!! There is a command on the 8051 to use external memory, data memory or code memory... All these do (as you so rightly say ) is include the High address register if need be...
I don't think that!! All you need to do is look at ASM code written by a professional against code written by a novice.
The advanced coder will code using indirect access, for speed and agility... Pointer make access simpler once you know how to use them. Pointers are, after all, using indirect addressing mode...
I don't think that!! All you need to do is look at ASM code written by a professional against code written by a novice.
The advanced coder will code using indirect access, for speed and agility... Pointer make access simpler once you know how to use them. Pointers are, after all, using indirect addressing mode...
It is not often I disagree with you but this is major! LOL
One of the advantages of using a compiler is that, if it is worth its salt, it will optimize the code. Generally the more straight forward the source the better job the optimizer can do on it.
Anyway there is no point in using pointers in c where you can use an array. Pun intended.
Pointers are for other things as well as arrays... Optimization isn't the issue here..
Lets move to structures, unions and indeed functions themselves... I find it much easier working on array's and structures using pointers...
I know its personal preference, It's not a " I can code you can't" kinda thing. Its how I learned to code in the first place.
I did most of my C code on a PC.... Not just on a PC..On MSDOS using DOS4GW extender... You have to use pointers as that's how the library is set up. Most libraries require pointers, take the string library, every function uses pointers!!
For example, if you have a variable and a routine that needs to modify the variable, instead of passing the variable to the routine, you pass the pointer to the variable. I have absolutely no idea how you can do this simple thing without pointers.
For example, if you have a variable and a routine that needs to modify the variable, instead of passing the variable to the routine, you pass the pointer to the variable. I have absolutely no idea how you can do this simple thing without pointers.
Some people just make every variable "global".. This is the case with small ram deficient micro's. I entirely agree that, in these situations, pointers are not required as you have no stack to worry about... Having said that, if you are used to using them, what does it matter if you do use them..