Jump to content
IGNORED

More Noobie Questions about bB


Recommended Posts

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.  

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?  

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.    

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...