Nybble Help Nybble Help
Page 1 of 2 12 LastLast
Posts 1 to 10 of 11

Thread: Nybble Help

  1. #1

    Richer than sasguru

    DimPrawn is a fount of knowledge

    DimPrawn's Avatar
    Join Date
    Jul 2005
    Location
    Brexit Britain
    Posts
    34,549

    Default Nybble Help

    If I XOR the upper Nybble of a tasty Byte, will I have more friends?
    I was miserable and depressed, but CUK turned it all around. Now I'm depressed and miserable.

  2. #2

    Pilchard

    Cliphead has more data than eek

    Cliphead's Avatar
    Join Date
    Nov 2005
    Location
    55°51'N, 04°12'W
    Posts
    9,653

    Default

    Quote Originally Posted by DimPrawn View Post
    If I XOR the upper Nybble of a tasty Byte, will I have more friends?
    Only of a certain 'type'

  3. #3

    Banned

    Churchill has more data than eek

    Churchill's Avatar
    Join Date
    Aug 2005
    Location
    On the rug licking my balls.
    Posts
    25,954

    Default

    If you do it twice you'll be where you started.

    See the (bit)pattern?

  4. #4

    My post count is Majestic

    NickFitz has reached the peak. Play again?

    NickFitz's Avatar
    Join Date
    Jun 2007
    Location
    Your local branch
    Posts
    45,811

    Default

    Quote Originally Posted by Churchill View Post
    If you do it twice you'll be where you started.

    See the (bit)pattern?
    Except in the case where you XOR it with itself... the first time will zero it, and the second will just leave it set to zero.

    This is why the "swap two values without an intermediate location" trick only works if you can guarantee that the two locations holding the values are different.



  5. #5

    Banned

    Churchill has more data than eek

    Churchill's Avatar
    Join Date
    Aug 2005
    Location
    On the rug licking my balls.
    Posts
    25,954

    Default

    Quote Originally Posted by NickFitz View Post
    Except in the case where you XOR it with itself... the first time will zero it, and the second will just leave it set to zero.

    This is why the "swap two values without an intermediate location" trick only works if you can guarantee that the two locations holding the values are different.


    Take the 'mask' off.

  6. #6

    My post count is Majestic

    NickFitz has reached the peak. Play again?

    NickFitz's Avatar
    Join Date
    Jun 2007
    Location
    Your local branch
    Posts
    45,811

    Default

    Quote Originally Posted by Churchill View Post
    Take the 'mask' off.
    You can't - if the source, mask and destination are all the same location (i.e. the value at that location is XORed with itself and the result stored back into that location in one atomic operation), then the mask has become zero.

  7. #7

    Super poster

    lilelvis2000 is a permanent contractor

    lilelvis2000's Avatar
    Join Date
    Jul 2005
    Location
    Armpit of UK
    Posts
    4,291

    Default

    Nybble - that was a cool mag. dedicated to Apple II. i can remember entering hex code by hand from the pages. What was hilarious is watching terminator and seeing the code scroll by.

  8. #8

    Dirty kapitalist spekulant

    DiscoStu has more data than eek

    DiscoStu's Avatar
    Join Date
    Aug 2007
    Location
    Andyw's mum's house
    Posts
    8,133

    Default

    I have absolutely no idea what any of you are talking about
    ǝןqqıʍ

  9. #9

    Lord of Ruin

    Diver is NOT a disguised employee

    Diver's Avatar
    Join Date
    Jun 2007
    Location
    Wales
    Posts
    22,873

    Default

    Quote Originally Posted by DiscoStu View Post
    I have absolutely no idea what any of you are talking about
    Never mind Junior

    Before your time son
    Confusion is a natural state of being

  10. #10

    My post count is Majestic

    NickFitz has reached the peak. Play again?

    NickFitz's Avatar
    Join Date
    Jun 2007
    Location
    Your local branch
    Posts
    45,811

    Default

    Quote Originally Posted by DiscoStu View Post
    I have absolutely no idea what any of you are talking about
    That's why it's called an exclusive or

Posting Permissions

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