We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am trying to link code into a ROM image which can be splitted into two regions later. Each region must starts at a predefined location respectively. How do I specify in my C code, and how to instruct linker to perform the link so each object goes to the right region in the image? Ming-I Sun
See the Macro Assembler and Utilities for 8051 and Variants User's Guide, A51.pdf All the manuals are on the CD, and are accessible via the 'Books' tab in the uVision Project window.
Can I do it in C instead of playing with assembly?
Who said anything about playing with assembly? Don't be fooled by the title of the manual - the same manual covers the Assembler, Linker, and other utilities. It's the Linker you need!
I'm trying to do pretty much the same thing, as I understand it. I want to locate code in the code space (beginning at 0x0000) with code data to transfer at 0x4000. Run the program to process this, and then vector to another code space beginning at 0x10000 and keep running with a new set of transfer code at 0x15000H. Since the code I'm running is identical, I found that I can switch back and forth between 0x0000 and 0x10000 using a pin from port 3. But I don't know how to locate the code. I have tried the "pragma" directive in C and making an assembly module. Neither has worked so far. But I'll try to let you know. John Stirton, Godigital, Fremont, CA, USA
The Compiler creates the object modules; the Linker assigns their addresses [1] Therefore you need to use Linker options - see the Linker manual. [1] some toolchains have a separate "Locator" which does this