I found the source of the problem. It is the DATA segment.
In this scenario it works.
Code:
MEMORY {
HEADER: start = $C000, size = $0004, type = ro;
ZP: start = $0000, size = $00D0, type = rw, define = yes;
RAM: start = $0200, size = $1E00, file = %O, define = yes;
ROM: start = $C200, size = $3CFF, file = %O, define = yes;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = ROM, type = ro;
LOWCODE: load = ROM, type = ro, optional = yes;
INIT: load = ROM, type = ro, define = yes, optional = yes;
CODE: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
DATA: load = ROM, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack
ZEROPAGE: load = ZP, type = zp;
}
But when i send the DATA segment in ram, it sets the jmp instructions to 0000
Code:
MEMORY {
HEADER: start = $C000, size = $0004, type = ro;
ZP: start = $0000, size = $00D0, type = rw, define = yes;
RAM: start = $0200, size = $1E00, file = %O, define = yes;
ROM: start = $C200, size = $3CFF, file = %O, define = yes;
}
SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = ROM, type = ro;
LOWCODE: load = ROM, type = ro, optional = yes;
INIT: load = ROM, type = ro, define = yes, optional = yes;
CODE: load = ROM, type = ro;
RODATA: load = ROM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes; # must sit just below stack
ZEROPAGE: load = ZP, type = zp;
}