How can I fill a 4 byte data patten as "0xFE 0xCA 0xBE 0xBA" to code area from address 0x7ffc to 0x7fff.
With a small assembler module like in: http://www.keil.com/support/docs/1623.htm
memcpy? Use the absolute access macros?
How about making the 4 bytes into a long constant then write it with a for loop?
"memcpy?" To code space? Neat trick if you can pull it off!
"To code space? Neat trick if you can pull it off!" Actually, it's really easy on a Triscend! But you're right - I missed the Code bit! :-(
"How about making the 4 bytes into a long constant then write it with a for loop?" So you also missed the bit that it's in Code space...?! ;-)
"With a small assembler module..." IF you want to stick with 'C': 1. Create a 'C' module that defines an appropriate initialised variable in CODE space - and nothing else. 2. Use the Linker to locate the resulting segment to the required address.
You could also patch the Hex file directly. Here's a toolkit for working with hex-format files: http://srecord.sourceforge.net (ALthough it's called "S-Record" it does also support Intel Hex).
Well, there's a whole bundle of options! The one thing you can't do, of course, is use the C51 _at_ keyword extension. :-(
"The one thing you can't do, of course, is use the C51 _at_ keyword extension." Gosh, wouldn't it be useful if you could use initialisers with the _at_ keyword? Such a small change, so many happy Keil customers.