Bitwise Operations


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76

    Default Bitwise Operations

    I need some clarification please. I know I've seen another entry on this but can't seem to find it with my searches.

    I have the need to manipulate individual bits of eight individual byte sized variables... such as change bit 3 of "mouse" to a one and bit five of "cat" to a one without changing any other bits in "mouse" or "cat".

    mouse var byte
    cat var byte
    mouse = 0
    cat = 0

    Main:
    mouse.3 = 1
    portd = mouse
    pause 1000
    cat.5 = 1
    portd = cat
    end

    Is this written correctly?

    Thank you,

    Ross
    Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!

    I like that! :-)

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi ross. yes it's write correctly
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Bitwise operations and masks: basics, help?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 19th April 2008, 00:24
  2. Math Operations on pbp
    By Jannia04 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th May 2007, 15:33
  3. Bitwise Operators
    By SterlingY in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 05:57
  4. Bitwise not working
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th October 2006, 07:31
  5. Bitwise AND
    By paul.mcallister in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th February 2005, 05:22

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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