Useless problem :)


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default Useless problem :)

    IF bit = 1 THEN '
    byte = $FF '
    ELSE '
    byte = $0 '
    ENDIF '



    Or......


    byte = $0 '
    IF bit = 1 THEN '
    byte = $FF '
    ENDIF '


    Or...


    byte = bit * 255 '

    Don't know what's faster or compiles to more code space.
    Any further ideas?

    Changing every bit in a byte to match the status of a seperate bit...

    Don't need the code anymore, but I still think I'm missing a better solution.

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default Re: Useless problem :)

    How about:

    byte=0-bit
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Useless problem :)

    Nice

    ...........

Members who have read this thread : 1

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