ram allocation possibilities?
kelvin james
Posts: 531
Just out of curiousity, i was thinking since the variable ram can be allocated to a bit, nib, byte or word, would it be possible to mathematically combine any of those to produce a different size variable? eg. BYTE plus a NIB = a 12 bit variable. I have kinda forotten some of the old hex math and laws involved with it, but it would produce a value range much more useable in my applications than using a full word value( 65536 ). This value would be assigned to a single variable. Seems like a lot of wasted ram to use a word, just to get a number higher than a Byte (256). Hopefully you can understand where i am coming from on this. Don't know if this possible because of the physical structure of the ram or the pbasic software, but it would be nice if i could be done. It would open up a lot of space for more variables in a program. Maybe a dumb question, but was just an idea i thought was worth asking. Thankyou.
kelvin
kelvin
Comments
Plus, the BS2 only has 26 bytes (13 words) of RAM anyway. You can easily add external EEPROM to store more data, and there does exist a RAM module as well.
Short answer -- it would be difficult, and it would have very limited applicability, and there are other solutions much easier to implement and more generally useful.