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 CCS Technical Support

How to define a lit23 GOTO in PCD?

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



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

How to define a lit23 GOTO in PCD?
PostPosted: Thu Sep 25, 2008 8:03 am     Reply with quote

Hello,

in EX_PCD_Bootloader.c, a jump to the real bootloader is performed by
Code:
      #asm
      goto LOADER_ADDR
      #endasm


For most PIC24 chips, LOADER_ADDR is a 23-Bit literal, e. g. 0x207FA.
PCD inserts a far GOTO instruction, but strips of the upper bits. Even inserting 23 Bit constant instead of a symbol doesn't generate the correct address.

There is also a built-in function goto_address(), but it seems to generate a near branch instruction unconditionally.

How to perform the necessary far GOTO?

Regards,
Frank
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Sep 25, 2008 8:30 am     Reply with quote

As an additional question, how to use symbols in literal MOV instructions, e. g.:
Code:
#asm
MOV  #LOADER_ADDR, W0

It gives an error Invalid Pre-Processor directive. I don't see that PCD provides an option.
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