poss compiler bug with complement (~) operator?


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    picyerknows
    Guest picyerknows's Avatar

    0 Not allowed!

    Default poss compiler bug with complement (~) operator?

    I've suspected this before when I've sometimes used the ~ operator in front of numeric constants to make the program more understandable when driving pos connected LEDS directly with hard wired patterns but have always been in too much of a hurry to investigate properly.
    Problem it seems is more general & manifests itself in this type of code:

    Dim portvar As Word
    ...
    PORTC=~(portvar>>8)
    where it just seems to ignore the ~ being there.

    workaround is the rather tedious:
    temp2=portvar>>8
    temp2=~temp2
    PORTC=temp2

    Is this something unknown or am I missing something obvious - or obscure?
    tia

  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
    Sparky1039
    Guest Sparky1039's Avatar

    0 Not allowed!

    Default

    workaround is the rather tedious:
    temp2=portvar>>8
    temp2=~temp2
    PORTC=temp2
    Try this...

    Code:
    portvar = portvar >> 8
    PORTC = ~portvar

  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
    bruce
    Guest bruce's Avatar

    0 Not allowed!

    Default

    This approach will save you around 6 program words: PORTC = ~portvar.HighByte

  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.

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Bug in Proton compiler 3.7.8.2 Not working for pic18f2550
    By davutnacikaya in forum Projects discussion
    Replies: 3
    Last Post: 10th October 2019, 12:10
  2. [SOLVED !] Compiler problem (Dare I say bug ?) Confirmed with Hserial 4800 baud
    By Kapitan in forum Proton Plus Compiler v3
    Replies: 8
    Last Post: 18th January 2009, 10:50
  3. [SOLVED !] A compiler bug?
    By llimis in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 18th April 2008, 02:19
  4. STR problem or compiler bug?
    By BeamSystems in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 11th April 2008, 10:12
  5. [SOLVED !] Possible Compiler Bug with Proton IDE V1.0.4.6
    By Willi Grundmann in forum Proton Plus Compiler v3
    Replies: 13
    Last Post: 21st February 2008, 20:34

Tags for this Thread

Posting Permissions

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