I am working a 6502 project in CA65, and I am having trouble understanding some of the directives.
What I want to do is have a segment defined as though it is in another part of memory, so that all of the addressing of that code is as though it was already in that segment of memory during compile, but it will be loaded with the main program and need to be moved into place after load... this is a pretty basic model for these old machines, but I am having trouble getting the DEFINE directive in the segment command to work properly.
So I have a MEMORY definition called MYMEM created in the cfg file as a location outside of where the program actually loads, say something like this:
MEMORY{
.
.
MYMEM start = $1000, size =$0200
.
}
and in I then create a segment called MYMEMSEG
SEGMENTS{
.
.
MYMEMSEG: load=MYMEM, type =rw, define=yes;
.
.
}
I then attempt to access the _ _MYMEMSEG_LOAD__ or _ _MYMEMSEG_RUN__ or _ _MYMEMSEG_SIZE__ values that it claims it creates, but they are all undefined... the generated MAP file does not contain anything with MYMEM or MYMEMSEG in them... so what am I not understanding here?
I think the linker exports them, but your code must import them: