Forum : Other families
Post Information | Post |
---|---|
December 17, 2009 - 10:34pm
|
Tools: Ride7 Hello All, I noticed that when I print a string constant such as " printf("Hello there \n"); ", When I experimented with a string constant such as " const static foo = "abdefg"; ", I tried to figure out a way to use part of the 8192 words of on-chip FLASH (program memory) to store the strings - since Flash memory is much more plentiful than Ram! After doing a little digging and looking at mixed C/Assembly listings it appears that the XE8801/CoolRISC_816 instruction set is a strict Harvard architecture that does not permit the instruction area to be accessed as data. It seems that the Indexed Addressing modes (that would be needed to access a contiguous text string in memory) are limited to using the data memory index registers (i0, i1, i2, i3) specified by the 2-bit subfield. The program memory index register (ip) is not referenced in the data move instructions. So it appears that the only way to output a long string is to use the "Immediate data" addressing mode - one character at a time such as: putchar('H'); Am I losing my mind? Or is there a better way to do this? Many Thanks for your input, |