Issue with new Compiler update

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Issue with new Compiler update

Post by David Barker » Fri Nov 21, 2014 10:27 am

OK, I've uploaded a new BETA (B4)

http://www.sfcompiler.co.uk/downloads/beta/

This should fix the math problem. I've also identified a problem with for...next termination when using shortint. This should also now be fixed. Let me know how it goes...

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Issue with new Compiler update

Post by Jerry Messina » Fri Nov 21, 2014 1:53 pm

B4 seems to fix those issues, but in going back through some of the recent test cases at some point a previous fix was undone/rebroke.
Both this case and the original, longer test case fail now (I think they were the same issue if I remember correctly). Here's the short one...

Code: Select all

{
 I diluted it further to this program:
That is, failed addition where S16 + S16 -> S32.  
This would cause the WRITE and IF statements to fail. 
Casting to integer results in S16 + S16 -> S16 which doesn't (appear to) 
have the same problem.
}
Device = 18F25K22
Clock = 64

#option _showvar = true

// standard SF routines
Include "convert.bas"
Include "usart.bas"

Dim a As Integer
Dim array1(135) As Byte  ' 134 is ok, larger number and addition fails
Dim b As Integer
Dim res As LongInt

' link in array...
array1(0) = 0

' set all digital...
ANSELA = 0
ANSELB = 0
ANSELC = 0
USART.SetBaudrate(br38400)

' add two integer (S16) to longint (S32) - Changing array1() will push
' the variables into different banks causing the addition to fail
a = 10
b = -20
res = a + b
usart.write(dectostr(res),13,10)

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Issue with new Compiler update

Post by David Barker » Fri Nov 21, 2014 4:31 pm

OK, I've uploaded a new BETA (B5)

http://www.sfcompiler.co.uk/downloads/beta/

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Issue with new Compiler update

Post by David Barker » Sun Nov 23, 2014 11:17 am

Try installing the latest update

http://sfcompiler.co.uk/phpBB3/viewtopic.php?f=1&t=1910

and let me know if it fixes the error for you.

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Issue with new Compiler update

Post by Jerry Messina » Sun Nov 23, 2014 2:13 pm

The new version worked for me w/all the tests I tried... hopefully it'll do the same for everybody else.

Thanks for all the effort.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Issue with new Compiler update

Post by David Barker » Sun Nov 23, 2014 4:40 pm

Thanks for the feedback Jerry...

Post Reply