defining memory space
Posted: Fri Jan 20, 2023 9:13 am
I'm trying to define my memory space for all of my variables in the following way currently.
RAM8_0 = $0300
RAM8_1 = $0300
RAM16_0 = $0310
...ettc
later in code I'll do something like
offset_counter = RAM8_0
byte_count = RAM8_1
index_ptr = RAM16_0
My problem is when I want to define a 2 byte variable for use as an indirect pointer I get an overflow error because the instruction doesn't know to treat the variable as 2 bytes. If i define the variable in the following way it works.
index_ptr: .res 2
My question is how do I assign a specific address for index_ptr AND let the compiler know to treat it as a two byte address. Thank you.
RAM8_0 = $0300
RAM8_1 = $0300
RAM16_0 = $0310
...ettc
later in code I'll do something like
offset_counter = RAM8_0
byte_count = RAM8_1
index_ptr = RAM16_0
My problem is when I want to define a 2 byte variable for use as an indirect pointer I get an overflow error because the instruction doesn't know to treat the variable as 2 bytes. If i define the variable in the following way it works.
index_ptr: .res 2
My question is how do I assign a specific address for index_ptr AND let the compiler know to treat it as a two byte address. Thank you.