Skip to main content
added 196 characters in body
Source Link
NickSoft
  • 207
  • 2
  • 8

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48 

option 3: The closest thing to a solution is to name all udata sections across the files with the same name and (very important) pad the space to more than 48 bytes:

in file1.asm

FirstBank udata variable1 res 1 variable2 res 1 res 48 ; this needs to be decreased if data in this section becomes ; Larger than 32 bytes. The idea is to keep ; data+padding > 48 so the section cat't fit in bank 2 

in file1.asm FirstBank udata variable3 res 1 variable4 res 1

But these are just workarounds, not real solutionsBut these are just workarounds, not real solutions.

UPDATE: Note that you shouldn't have to worry about liker starting from bank other than 0 with MCUs that have all banks with the same size. For example for PIC16F648A linker starts from bank 0.

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48 

option 3: The closest thing to a solution is to name all udata sections across the files with the same name and (very important) pad the space to more than 48 bytes:

in file1.asm

FirstBank udata variable1 res 1 variable2 res 1 res 48 ; this needs to be decreased if data in this section becomes ; Larger than 32 bytes. The idea is to keep ; data+padding > 48 so the section cat't fit in bank 2 

in file1.asm FirstBank udata variable3 res 1 variable4 res 1

But these are just workarounds, not real solutions.

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48 

option 3: The closest thing to a solution is to name all udata sections across the files with the same name and (very important) pad the space to more than 48 bytes:

in file1.asm

FirstBank udata variable1 res 1 variable2 res 1 res 48 ; this needs to be decreased if data in this section becomes ; Larger than 32 bytes. The idea is to keep ; data+padding > 48 so the section cat't fit in bank 2 

in file1.asm FirstBank udata variable3 res 1 variable4 res 1

But these are just workarounds, not real solutions.

UPDATE: Note that you shouldn't have to worry about liker starting from bank other than 0 with MCUs that have all banks with the same size. For example for PIC16F648A linker starts from bank 0.

Added another workaround solution
Source Link
NickSoft
  • 207
  • 2
  • 8

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48 

placeHolder udata 0x011Foption 3: res 48The closest thing to a solution is to name all udata sections across the files with the same name and (very important) pad the space to more than 48 bytes:

in file1.asm

FirstBank udata variable1 res 1 variable2 res 1 res 48 ; this needs to be decreased if data in this section becomes ; Larger than 32 bytes. The idea is to keep ; data+padding > 48 so the section cat't fit in bank 2 

in file1.asm FirstBank udata variable3 res 1 variable4 res 1

But these are just workarounds, not real solutions.

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48

But these are just workarounds, not real solutions.

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48 

option 3: The closest thing to a solution is to name all udata sections across the files with the same name and (very important) pad the space to more than 48 bytes:

in file1.asm

FirstBank udata variable1 res 1 variable2 res 1 res 48 ; this needs to be decreased if data in this section becomes ; Larger than 32 bytes. The idea is to keep ; data+padding > 48 so the section cat't fit in bank 2 

in file1.asm FirstBank udata variable3 res 1 variable4 res 1

But these are just workarounds, not real solutions.

added 239 characters in body
Source Link
NickSoft
  • 207
  • 2
  • 8

I want to add a non-optimal solution that actually works, but it's not that convenient. If Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48

But these are just workarounds, not real solutions.

I want to add a non-optimal solution that actually works, but it's not that convenient. If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

I want to add a non-optimal solution that actually works, but it's not that convenient. Option 1 If all variables that need to be in bank 0 are listed in only one file and exported with "GLOBAL" an udata section with fixed address would do the job. I'm still waiting if someone will sugest something that allows to address bank 0 from multiple assembler files (objects). Maybe there is a way to pass the name of bank as mentioned in linker script or some way to force linker to start with bank 0.

option 2: Of course if you don't use bank2 at all a "place-holder" can be used to allocate all GPRs in bank2:

placeHolder udata 0x011F res 48

But these are just workarounds, not real solutions.

Source Link
NickSoft
  • 207
  • 2
  • 8
Loading