News:

;) This forum is the property of Proton software developers

Main Menu

Compiler problem with assembler error for FSR0H

Started by Colin G3YHV, Oct 02, 2021, 08:19 AM

Previous topic - Next topic

Colin G3YHV

Hello. I have just discovered that programs I have written earlier this year
no longer compile .  I get the following error
Error 115 Duplicate label (FSR0H or redefining symbol cannot be redefined)
Its a long program in a PIC 18F26K22  - I an running the latest version of Positron.
Any ideas !  Colin G3YHV

trastikata

Quote from: Colin G3YHV on Oct 02, 2021, 08:19 AMAny ideas !   Colin G3YHV

Colin, can you strip the code to a smaller program and check if it still causes problems, if it does it would be better posting it here so we can have a look.

Colin G3YHV

Not easy to do !  about 1000 lines of code plus a number of include files needed.
so not sure how to proceed.
Colin

top204

#3
With that type of assembler error with an SFR (Special Function Register), you have the SFR's name also created in your program. For example:

Dim FSR0 As Word

Or more likely:

Dim FSR0 As FSR0L.Word

This will mean that the assembler sees 2 variables named FSR0H because it is also in some assembler files, depending on what name Microchip had chosen that particular month for its data files that were then used to create the compiler's data files.

Whenever creating, or aliasing, SFR variables, always add a prefix, or a few extra letters, to the name so they do not clash with the directives used by the assembler. For example:

Dim wFSR0 As Word

or

Dim wFSR0 As FSR0L.Word

The assembler used in the Positron8 compiler is the latest version because of the new devices added, and it does have some differences to the previous assemblers.

Colin G3YHV

Hi Les  -  good morning
Thanks for that quick response !
I searched my program for that occurrence -  not found
I suspect its in one of the include files  -  I will have a search later today
Just off for my flu jab now !   :)
Colin

Colin G3YHV

I found the problem in the Include file  SSD1306_Def_v1.11.inc
Which I use to drive one of the oled displays.
Changed as per your instructions
Thanks for the Info Les  -  all working ok now.
Colin

Dompie

Thanks Collin. I will change "Dim     FSR0        As FSR0L.Word" and the consequences in my next update, together with some other points.

But at the moment I'm on vacation ;D

Johan

Dompie

#7
@Collin the new version is in the download section Graphic&SSD1306_20220701

Johan

[Edit: I am ashamed: 9 month later]