PDA

View Full Version : Useless problem :)



Art
- 8th March 2012, 16:20
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.

Kamikaze47
- 9th March 2012, 20:29
How about:

byte=0-bit

Art
- 10th March 2012, 00:25
Nice ;)

...........