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...
Issue with new Compiler update
Moderators: David Barker, Jerry Messina
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: Issue with new Compiler update
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...
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)
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
- 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
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.
http://sfcompiler.co.uk/phpBB3/viewtopic.php?f=1&t=1910
and let me know if it fixes the error for you.
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: Issue with new Compiler update
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.
Thanks for all the effort.
- 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
Thanks for the feedback Jerry...