CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

data content of pointer in CCS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








data content of pointer in CCS
PostPosted: Fri May 28, 2004 3:44 am     Reply with quote

how can u read the data pointed by a certain register so that you could transfer it to another register?
Ttelmah
Guest







Re: data content of pointer in CCS
PostPosted: Fri May 28, 2004 5:11 am     Reply with quote

Anonymous wrote:
how can u read the data pointed by a certain register so that you could transfer it to another register?

The same way as in any C.
int8 value;
int8 *pointer_to_value;
int8 second_value;

pointer_to_value=&value;
second_value=*pointer_to_value;

The first line says that 'value' is an 8 bit integer. The second says that 'pointer_to_value', is a pointer to an 8bit integer (note that the variable itself, will then normally be a 16bit number). Then 'second_value' is another 8bit integer.
Then pointer_to value, is loaded with the address of 'value.
Finally, second_value, is loaded with the contents addressed by 'pointer_to_value'.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group