Struggling with Error messages - Older version of the compiler issues?

Started by jacquesg, Jun 07, 2023, 01:37 PM

Previous topic - Next topic

jacquesg

Hi

I got code (.bas) and matching .hex files from a contractor

I am trying to compile using his code and comparing my resulting hex with his. I need the resulting hex to be the same.

I get these errors (in attachment) that I fix and it produces a non matching hex file.

Can I roll back to an older version of compiler? Is the issue related to IDE?

I use:
mecanique
Proton IDE
IDE version 2.0.3.3

Proton BASIC Compiler
Loader version 1.0.1.4
Compiler version 3.5.9.6

If I do need to roll back compiler or IDE versions, how do I get hold of the installs?

Thanks in advance - any help would be appreciated

J

John Lawton

3.5.9.6 was issued 10th May 2017. I have that version but you will need a dongle to run it

jacquesg

Hi John

Thanks kindly - but let me clarify - I do have 3.5.9.6 and a dongle and it produces errors noted above.

(I am asking the contractor for the versions of IDE and compiler he used but he has not replied yet)

For example to get it to compile I need to change the contractor's code:
- adding a declare before PortB_Pullups = Off
- changing the label "Loop" to Start or Main.

It seems the combination of these changes and the Compiler and IDE versions I am using significantly changes the resulting hex file compared to the one the contractor produced. I need to find the issues that cause the resulting incorrect hex file.

J

John Lawton

Ah, sorry. Did the contractor provide the .asm assembly file, the top two lines would provide the answer.

top204

The early compilers did not require the Declare statement, but the newer compiler versions do. Also, the Loop text was added as a command, so it is a protected word and cannot be used as a label or variable name.


See_Mos

and the changes J has noted so far should make no changes to the way the code works however changes and improvements to the compiler may result in more compact and more efficient code

tumbleweed

If you're working with a contractor and want to be able to replicate the output then you should use the same version of the compiler, along with all the same libraries and include files.

jacquesg

I got the ASM file from the contractor, it states: Code Produced by the Proton Compiler. Ver 3.5.2.1

I could not find 3.5.2.1 but I found http://pds.protonbasic.co.uk/Files/?dir=Version%203_5/Version%203_5_2_2

I installed it and recompiled. Still produced very different Hex file.

It turns out the latter installed version of compiler was not used - I uninstalled both versions and reinstalled 3.5.2.2

Resulting hex file is now 90% identical and seem to act the same on hardware as my original hex file I tried to reproduce.

It is strange to me that the compiler could affect code function so much.

Anyway thanks for all the help - for now my issue is resolved!

tumbleweed

When you're done be sure to get copies of ALL the source files used by the contractor.
(I'd have him zip up the entire ProtonIDE and PDS folders).

That way, in the future when the contractor disappears or you need to recreate the project you'll have all the files (s)he originally used.

top204

QuoteIt is strange to me that the compiler could affect code function so much.

Version 3.5.2.1 is from 2011! That is 12 years ago!

Of course things will have changed, and the compiler has been added too and improved and optimised many times since then, so the assembler code will be very different to the assembler code produced 12 years ago. It is called "evolution".

I have tried my damnest to keep backward compatability as much as possible, but sometimes, change is a necessity and nothing can be done to keep 100% backward compatability. Without changes and improvements, the compilers would just be like other "expensive" compilers that have not changed or improved for many, many years and are not really suitable for modern devices.

flosigud

I prefer progress over standardization and backwards compatibility. The compiler was good to begin with and has advanced drastically. It is definitely a better tool than 12 years ago.

top204

Many thanks for your kind words. :-)

Whenever working on a project, especially for a third party:

1. Always place a note in the source code's header texts for what compiler version it is compiled in. This is standard practice across all types of computer languages and applications for documents and projects etc, because things change over time. I even have virtual machines running older operating systems for some important development applications that will not run in the later Windows systems, and the newer versions will not work with the existing files I have, but the final product they create will happily run in Windows 10 and 11.

2. Always keep a copy of the compiler used, by zipping up the "C:\Program Files (x86)\ProtonIDE\" folder and renaming it to the compiler's version. Then if it is required, unzip it to a new folder and everything the compiler requires is in that folder, so you have the compiler version used in full.

tumbleweed

Shouldn't you also keep a copy of the user's PDS folder?

QuoteNotes
The file to be included into the BASIC listing may be in one of three places on the hard drive if a
specific path is not chosen.

3... Within the user's Includes folder, located in the user's PDS directory.