When you program in C with CC65, it needs some variables to do certain stuff: ptr1, ptr2, ptr3, sp and maybe some other things.
My question: How are these variables stored in memory and do I have to adjust my config file accordingly, so that my variables don't overlap with them?
To elaborate:
Are these variables stored in absolute memory locations in the zero page, so that I have to declare my zero page segment as going from address $0008 and being 248 bytes long instead of starting at $0000 and being 256 bytes long?
Or do these variables internally use the segment names as well, like this:
My question: How are these variables stored in memory and do I have to adjust my config file accordingly, so that my variables don't overlap with them?
To elaborate:
Are these variables stored in absolute memory locations in the zero page, so that I have to declare my zero page segment as going from address $0008 and being 248 bytes long instead of starting at $0000 and being 256 bytes long?
Or do these variables internally use the segment names as well, like this:
Code:
.segment "ZEROPAGE"
prt1: .res 2
prt2: .res 2
prt3: .res 2
sp: .res 2
so that they can never overlap with my own variables if I use the segment declaration?prt1: .res 2
prt2: .res 2
prt3: .res 2
sp: .res 2