Bit Masking and Or?


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Hi Joe,

    So....

    Data @0 , 6

    read 0, x

    Would the variable x be equal to 00000110b

    so then to make it 00100110 I would OR it with 00100000?


    Thanks, Don

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    http://en.wikipedia.org/wiki/Bitwise_operation
    I am not a MATH Guy, but I believe in the example you listed, a bitwise OR would do that. Here is a link with some info. Or cannot you just add the 32 to six ?
    Last edited by Archangel; - 24th February 2009 at 06:35.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    with PBP, 4 Bit number don't exist. I know STAMPs have Nibble variable, but not in PBP. You have Bit, BYTE, and WORD. So you could use OR or just directly set the bit you want

    ByteA = %110
    ByteA.5=1

    should do the trick as well.
    Steve

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

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