Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/13/01 23:51
Read: times


 
#12465 - RE: keil C: abstarct pointer
Hi Peter,

"abstarct pointer" is just a typo; he means "abstract pointer"

Abstract Pointers are described in Chapter 3 on p109 of the Keil C51 User's Guide (in the 11.2000 version).

Standard ANSI 'C' uses the term "generic pointer" where Keil uses the term "abstract pointer" - unfortunately, Keil have usurped the ANSI term "generic pointer" to mean something different!!

An "abstract pointer" is just a general pointer to any arbitrary memory location without the need to specify a type - such as char, int, struct xxx, etc
They are sometimes also known as "void pointers" (not to be confused with Null pointers), because the ANSI definition of an "abstract pointer" is:
void *p;
Probably the commonest example is in malloc() - which just allocates you a block of memory; it has no idea what you want to put into it, so cannot use a normal, typed, pointer. Therefore it uses the "abstract" pointer, void *

void pointers cannot be dereferenced without explicit casting because the compiler cannot determine the size of the pointed-to object.

Things are a bit more complicated when it comes to the 8051, because the compiler needs to determine not only the size but also the memory space of the object; viz DATA, IDATA, PDATA, XDATA, or CODE - you can't just take any pointer value and apply it willy-nilly to any address space.
These are the issues addressed by Keil's section on "Abstract Pointers" in the C51 manual.



List of 9 messages in thread
TopicAuthorDate
keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      
RE: keil C: abstarct pointer            01/01/70 00:00      

Back to Subject List