Creating large array
Rus
Posts: 3
Hello. Need help to create 256 bites long array.
I have BS2px. I get variable size too large when I try to declare array (array_name· VAR Bit (256)). I guess I am out of RAM space.
Is there any work around? I need serially shift 256 values (0 or 1), and I do not want to create several small arrays.
·
Thank you
I have BS2px. I get variable size too large when I try to declare array (array_name· VAR Bit (256)). I guess I am out of RAM space.
Is there any work around? I need serially shift 256 values (0 or 1), and I do not want to create several small arrays.
·
Thank you
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 7/24/2008 9:33:11 PM GMT
Also , if I need insert data to index 35-40, what is the procedure?
Thank you
Just set the index value, the desired bitval and it's done.
Each byte holds 8 bits. So when the param (the index) is shifted right 3 times, that divides the index by 8, resulting in byte 0-31. Then the routine gets the byte at that location in SPRAM. Then the lowest 3 bits of the param (the index bit desired) are used to set/get the bit WITHIN that byte that corresponds to the desired index.
e.g.
35 >> 3 (i.e. 35/8) = 4 --> working with byte index 4 (5th byte from bytes 0-31)
35 & $07 (i.e. 35//8) = 3 --> working with bit index 3 (4th bit of byte)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php