bit variables, and nibble,and shift nibble,and "new nam

Post your requests and ideas on the future development of mikroBasic.
Post Reply
Author
Message
cymb
Posts: 464
Joined: 30 Nov 2008 01:19
Location: indiana usa

bit variables, and nibble,and shift nibble,and "new nam

#1 Post by cymb » 26 Jan 2009 15:18

there was some discussion about "noting"bits and how it did not work and i assume the bit var will fix that,or simplify it.
the 4 bit "nibble var was also mentioned, like the stamp uses and it seems like 4 bits show up in a lot of projects, like displays,etc, so a nibble var would seem like a good thing.
now some "green light thinking"(anything goes!):
a 4 bit nibble that can be shifted around in the byte to pick up a 4 bit group of bits, like 7-4 and 3-0 are normal but 6-3 or 5-2or 4-1.
the next step would naturally be "off the wall", and be a "variable variable" with its size and bits selected by numbers 0 thru 255. this would be a byte var i guess.
this seems very complicated but i can assure you a lot of functions seem complicated to people who dont ues or need them(like me!)but are simply routine to the seasoned veterans.

soooo,, you might need to invent a new name for the "crazy"variable variable" but if this is a new idea ME might have some fun with it.

it seems like it would end the need to mess with a lot of other methods of getting control of "various" bits like when setting control registors. and i suppose i may be missing something obvious but i dont mind sounding dumb if it is helpful down the road!!

make any sense??

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

#2 Post by Dany » 26 Jan 2009 17:27

Hi, in the unit http://users.edpnet.be/rosseel01/DRO/PIC/BitUtils.ppas there are some "Bit Stuff" functions, which do things like you seem to suggest (I think). They set/retrieve bitgroups (which can be nibbles) in a byte. It should be rather easy to make "word" versions of them.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

cymb
Posts: 464
Joined: 30 Nov 2008 01:19
Location: indiana usa

Rosseel bit stuff

#3 Post by cymb » 28 Jan 2009 00:03

i'm reading and rereading and find the bit stuff interesting. the "bit number and size" goes beyond the 4 bit "moveable" nibble i mentioned,,neat idea.

doesn't it seem like being able to pick out specific bits anywhere in the byte, and acting on them ,alone , would simplify work with control registers.?
just one example of hundreds:

i went to the microchip data sheet for 12f675 which is othe only one i had printed previouslyand picked "pir1",,bits 7,6,3,0 are used.

that would relate to decimal 197 or hex c9 to identify the bits.

then if they could be treated as if they were in one 4 bit group or nibble , any time they had to be checked or changed it would seem to be simple to do.
this could be done with any number as Rosseel did but pick any bits and not just all itogether, like bits 7,5,4,3,0= hex AD (check my math), and then group them together.,,,???

so any way its something to consider if ME is adding bit variables it seems like a small step when so much more can be done as Rosseel has already shown, hats off to him!!

thanks

Post Reply

Return to “mikroBasic Wish List”