Empty if..endif bug


+ Reply to Thread
Results 1 to 9 of 9

Thread: Empty if..endif bug45 days old

  1. #1
    Junior Member
    Join Date
    Feb 2020
    Posts
    7
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Empty if..endif bug

    Hi,

    Noticed couple of bugs with 3.6.0.2 (not updating further as i need to keep this version stable).

    Code:
    loop:
    If dummy = 1 then
        'Nothing here
    endif
    goto loop:
    When "if" does not contain anything, the program will omit the next line (in this example, goto loop)

    Same is true for Select Case. Empty last Case (and probably elsewhere too) will omit the next line right after End Select.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,515
    Thumbs Up
    Received: 319
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Empty if..endif bug

    Tests in the current version of the compiler, which is 3.7.3.6, shows it works as expected.

    Please.... If a user is going to report a "possible" anomaly, make sure it is the latest compiler version otherwise, it serves no purpose.

    Version 3.6.0.2 is quite an age now, and lots has been added and corrected in the compiers since then. For example, the name "Loop" is now a command with Do..Loop so it cannot be used as a label anymore, also the "big" addition to the 8-bit Proton compiler are procedures, which give a huge flexability and extra power to the Proton Compiler for 8-bit devices.
    Last edited by top204; 21st February 2020 at 16:48.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Empty if..endif bug

    If I may add to Les's reply from a users viewpoint: this compiler is used by a very large community of forum members. Les is very responsive to ideas for improvements and reports of strange happenings. He has rewritten the compiler for the 24 series of chips and added a comprehensive range of facilities to both versions. Welcome to this forum but please, take a positive approach and find out what the latest version offers.

    Charlie

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member
    Join Date
    Feb 2020
    Posts
    7
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Empty if..endif bug

    Les, i retested it myself and the actual bug requires that the evaluated condition is not met. Otherwise it acts correctly. I just wanted to make sure this does not effect others as its very tricky to spot and could raise its head when code is changed or commented out later on.

    Sharedb1 = 1
    If Sharedb1.0 = 0 Then
    'Nothing here
    EndIf
    Sharedb1 = 0 ' <- This line is not reached
    Produces this assembly code:

    movlw 1
    movwf Sharedb1,0
    F1_000314 equ $ ; IN [] IF SHAREDB1.0 = 0 THEN
    btfss Sharedb1,0,0
    F1_000316 equ $ ; IN [] ENDIF
    _LBL__476
    F1_000317 equ $ ; IN [] SHAREDB1 = 0
    clrf Sharedb1,0
    ps. The procedures would be super handy, have to test it out. And just tried this with recent compiler, the bug is no longer here (neither Select Case bug).
    Last edited by Picprogrammer; 22nd February 2020 at 20:02.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,532
    Thumbs Up
    Received: 75
    Given: 33
    Total Downloaded
    6.56 GB

    1 Not allowed!

    Default Re: Empty if..endif bug

    Quote Originally Posted by Picprogrammer View Post
    The procedures would be super handy, have to test it out. And just tried this with recent compiler, the bug is no longer here (neither Select Case bug).

    Picprogrammer,

    Please, Les made it clear that the compiler you are using is old, and as you discovered the anomaly was ironed out. I do not think your request for version 3.6.0.2 will be fixed. If it is fixed in the last compiler than move on to the last compiler please, but do not complain that older version had this anomaly.
    Regards

    Joseph

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,515
    Thumbs Up
    Received: 319
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Empty if..endif bug

    At compile time, the compiler has no idea whether a comparison is true or false if there is a variable, or variables, involded! That can only be acheived at run time. Think about it?

    For example: At compile time, there is a comparison in the program such as If MyByte = 10 Then.... The compiler has no idea what is going to be held in the variable "MyByte" when it is creating the code, so it cannot create different code for a true or false result. The only time the compiler knows if a comparison is going to be true or false at compile time is if a pointless comparison such as If 1 <> 2 Then is done, then it creates a true or false jump depending on the constant values and does not bother with the comparison code.

    I've ran more tests on the compiler and it creates the underlying asm code just as it should, regardless of the comparison code.
    Last edited by top204; 23rd February 2020 at 18:12.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Member Frizie's Avatar
    Join Date
    Apr 2003
    Posts
    178
    Thumbs Up
    Received: 2
    Given: 1
    Total Downloaded
    741.23 MB

    0 Not allowed!

    Talking Re: Empty if..endif bug

    Look at the last line 'Picprogrammer' wrote:
    "ps. The procedures would be super handy, have to test it out. And just tried this with recent compiler, the bug is no longer here (neither Select Case bug)"

    So, problem solved (many Proton versions ago )

    Frizie.
    Ohm sweet Ohm: www.picbasic.nl

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Junior Member
    Join Date
    Feb 2020
    Posts
    7
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: Empty if..endif bug

    Quote Originally Posted by top204 View Post
    At compile time, the compiler has no idea whether a comparison is true or false if there is a variable, or variables, involded! That can only be acheived at run time. Think about it?

    For example: At compile time, there is a comparison in the program such as If MyByte = 10 Then.... The compiler has no idea what is going to be held in the variable "MyByte" when it is creating the code, so it cannot create different code for a true or false result. The only time the compiler knows if a comparison is going to be true or false at compile time is if a pointless comparison such as If 1 <> 2 Then is done, then it creates a true or false jump depending on the constant values and does not bother with the comparison code.

    I've ran more tests on the compiler and it creates the underlying asm code just as it should, regardless of the comparison code.
    My point was, that the line skipping could be found out only, when the code tried to run an empty if-endif structure, not when it naturally passed it. Since this is no longer a problem, i think this thread should be locked or deleted. My previous account got swiped away and i was unable (= too lazy) to report this earlier.

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,532
    Thumbs Up
    Received: 75
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Empty if..endif bug

    Quote Originally Posted by Picprogrammer View Post
    My point was, that the line skipping could be found out only, when the code tried to run an empty if-endif structure, not when it naturally passed it. Since this is no longer a problem, i think this thread should be locked or deleted. My previous account got swiped away and i was unable (= too lazy) to report this earlier.
    For me this thread should not be deleted.

    If someone runs into a similar problem he / she will know that the problem was solved with latest version of the compiler.

    And also, for those who had read this thread, they will know to try the latest version, to know if such anomalies had been ironed out.
    Regards

    Joseph

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Unbalanced $if $endif statements
    By towlerg in forum Tips 'n Tricks
    Replies: 3
    Last Post: 27th August 2019, 20:16
  2. End If instead of Endif
    By towlerg in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 7th July 2017, 12:14
  3. [SOLVED !] array stays empty
    By vissie in forum Absolute Beginners Section
    Replies: 8
    Last Post: 26th October 2013, 07:53
  4. [SOLVED !] Library empty
    By grahamg in forum Library Manager
    Replies: 3
    Last Post: 6th March 2012, 05:07
  5. If Then Else EndIf
    By johngb in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 1st December 2004, 19:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts