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 embed data into ROM on PIC18F - equivalent of DB

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



Joined: 20 Sep 2004
Posts: 14
Location: Sacramento, CA

View user's profile Send private message

How to embed data into ROM on PIC18F - equivalent of DB
PostPosted: Wed Dec 07, 2005 6:01 pm     Reply with quote

If I am using MPASM I can do the following:

Code:
MyLabel:
  data  "some text",0xFF,0xAA
MyOtherLabel:
  DB    'A','B','X',0x55,'Z',0x00


This will store the appropriate data into ROM and then the address of MyLabel can be used to access the data.

The CCS compiler offers the label_address() function, but does not support either the data or DB directives in an #ASM block.

Is there another way to achieve the same thing? It would be most helpful if this could be achieved as shown above - the data being placed into ROM is configuration data for another device and will be moved to the device using an Assembly routine.

Any and all suggestions would be useful, even if it is just to state that this is impossible with the CCS tools.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 07, 2005 6:14 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=22070&highlight=rom+const
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Dec 07, 2005 6:50 pm     Reply with quote

Here's another way

Code:

#define Table 0x0C80   // specify where in program memory we want the table
#rom Table = {0x8C01,0x01EF,0x0023,0x0000,0x0000}

_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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