PDA

View Full Version : Math question



Ioannis
- 6th May 2012, 11:36
Is there a better way to find a block of flash memory from the index counter that shows next address?

I came with this equation:
((index-block_start)/8)*8

It may look that /8)*8 is redundant but PBP is using integer only and the result of the equation is showing at the start of the block.

Any other idea welcome.

Ioannis

Darrel Taylor
- 6th May 2012, 19:18
How about ...

index & %11111000

Ioannis
- 6th May 2012, 21:40
Oh dear...

Thanks Darrel.
Ioannis