











Example Linker Command File
PAGE 0: EPROM: org = 0E000h len = 01F80h
VECS: org = 0FF80h len = 00080h
PAGE 1: SPRAM: org = 00060h len = 00020h
DARAM: org = 00080h len = 01380h
DEPROM: org = 08000h len = 08000h }
Notes:
The code, which is located in the .text section was at 8,000 in program memory, and the dot data section is going to be in the EPROM at address 8,000. Someone may point out that we shouldn't be putting .data section in EPROM, and that's probably true, but we have done so in this example to demonstrate the possibility.
Now suppose we didn't want the .data section to go into the DEPROM. Suppose I wanted it to go in SRAM. Then next to the.data section, I would replace the DEPROM reference with an SRAM reference and the linker would put it in the new desired location.
In the memory section, let's find the code. It is actually down in the bottom. It's called .text. We’re going to put that, in the middle of the “sections” section in EPROM, and note that the memory section says EMPROM starts at address 8,000 and it has a particular length (01F80h).
We can also look down at the bottom for the .data section in “sections”, where the data section appears in the memory section called DEPROM. If we look back up in the memory section to understand the hardware section, we see its DEPROM, originating at 08000h with length 08000h.