View previous topic :: View next topic |
Author |
Message |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Putting bytes in rom in an easy human readable fashion |
Posted: Fri Oct 21, 2005 9:31 am |
|
|
Hi
I want to store data, such as IP addresses at a fixed location in program memory that is both in a human readable fashion and memory efficient.
In MPASM I would do this: Code: |
MIP DB 230, 10, 10, 11 ; IP address 230.10.10.11 |
But DB is not supported by the CCS assembler.
I know I can do this in CCS but it is unreadable: Code: |
#rom MIP = {230 | (10 <<8), 10 | (11 <<8)} // 230.10.10.11 |
Ideas welcome... _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Fri Oct 21, 2005 9:36 am |
|
|
It seems that MIP is a 2 16 bit variables. Why not 4 bytes? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Fri Oct 21, 2005 9:39 am |
|
|
Quote: | It seems that MIP is a 2 16 bit variables. Why not 4 bytes? |
Because then the compiler consumes 8 bytes of rom space. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Fri Oct 21, 2005 9:46 am |
|
|
Thanks - much more readable. I searched old posts but obviously missed it. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|