Jump to content
Sign in to follow this  
Asmotaku

Dereferencing

Recommended Posts

Well, some ANSI-C newbies could ask "what is dereferencing".

It concern the use of "&" preceding a var's symbol.

 

Then, using indirect addressing with FSR, it's common sense to think of :

char myvariable[10]

char idx;

for(idx=0; idx<10; idx++)

{

  fsr = &myvariable  + idx;

  indf = something;

}

/* instead of  */

 

for(idx=0; idx<10; idx++)

{

asm

{

  bank     _myvariable ; risky while using .lib modules ;

 

  movf     _myvariable,W

 

  movwf   FSR

 

  movf     _something,W

  movwf   INDF;

}

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×