+Living Room Arcade Posted August 27 Share Posted August 27 Combining Unused Bits into a Byte Got a noobie question for you guys. Can anyone help me with this? So, I've been working with bB for a couple of months now, and sometimes in my programs I find that I have a few unused bits, all from different memory locations in RAM. So what I'm wondering is, is there any way to combine eight of those unused bits into a single byte that I can read from and write to just like an ordinary a-z byte of RAM? Any help is appreciated. Thank you. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 27 Share Posted August 27 Are you talking about using bits for different jobs like this? dim _Bit0_Hero_Shot = a dim _Bit1_Hero_Thrust = a dim _Bit2_Hero_Crash = a dim _Bit3_Hero_Shield = a dim _Bit4_Enemy_Shot = a dim _Bit5_Enemy_Thrust = a dim _Bit6_Enemy_Crash = a dim _Bit7_Enemy_Shield = a If so, and you are using bits in a few different variables, you could just carefully rename them and move them into one variable instead of being spread out. But I could be misunderstanding your question. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted August 27 Author Share Posted August 27 Hey, @Random Terrain. It's a real pleasure to be messaging with you here in the forum. Do you know I've been using your online bB Guide for the last few months? What a treasure trove of info about bB you've put together there. I want to thank you for doing that. It's truly a treasure. About my question - no, that's not my meaning. My meaning is sort of like the reverse. Suppose the following bits are free: a{8}, b{8}, c{8}, d{8}, e{8}, f{8}, g{8} and h{8}. Could these eight, separate bits be combined, somehow, into a single byte? See what I'm saying? What do you think? 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 27 Share Posted August 27 From what I understand, bits are from 0 to 7, so something like a{8} shouldn't be valid. Seems like a{7} would be what you mean. As far as I know, what you are asking is not possible. If you would be using 0 through 6 of the bits individually in each variable, you could move them so b{0} would be moved to a{7} and keep moving everything until you end up with h as a free variable. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted August 27 Author Share Posted August 27 @Random Terrain Quote Seems like a{7} would be what you mean. Yes, that's what I meant. Quote As far as I know, what you are asking is not possible. If you would be using 0 through 6 of the bits individually in each variable, you could move them so b{0} would be moved to a{7} and keep moving everything until you end up with h as a free variable. I see. Alright. Thanks, RT. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.