Forum Beginners storing two nibble in a byte. Mar 23, at am UTC. I am involved in a project which requires to store two nibbles in a byte. Last edited on Mar 23, at am UTC. Read up on the bitwise operations. Mar 23, at pm UTC.
I said logical not bitwise, I do things C Jitter - Coeval - Nibbles that sometimes, sorry. Also, a warning I think that will break things. I was thinking that if you had to ask, you might not know how to use what C Jitter - Coeval - Nibbles said. But it will print backwards in hex, because of this, though logically a is first. You can also avoid the pointer mess with a union A couple of lines They Cant Take That Away From Me - Peggy Lee - They Cant Take That Away From Me assembler could do this, if you wanted to really go off on a tangent!
Last edited on Mar 23, at pm UTC. Mar 24, at am UTC. Last edited on Mar 24, at am UTC. Jonnin, the packing of bitfields isn't guaranteed by the standard. In other words, there's no guarantee that this structure will occupy one byte. Says Allocation of bit-fields within a Brutal Ben - Scum Of The Earth! - Exorcism Be Damned! object is implementation-defined. Alignment of bit-fields is implementation-defined.
It's either bitfields or unions since reading the non-active variant member causes undefined behavior which have my vote for the least-useful core language feature. I digress. It's fine to make class types with bit-field members non-POD as long as you don't later assume they're not although that assumption is quite usual for such a class.
Mar 24, at pm UTC. I agree, but in practice, I have yet to find this theoretical compiler that does not work on the above code as I laid it out.
Someone here probably knows of one, I don't use that many different compilers. Honestly, the idea of a nibble is useless to me unless packing something up for an embedded system that wants 2 per byte in its communications protocol. There are not a whole lot of those left in the world either. If your compiler works as above, its probably the cleanest way to do the nibble thing. Its easy to test if it works. Run it, and see if your struct is size 1 : If not, you need to do something else.
Aren't al and ah the low byte and high byte of ax? I don't recall 4-bit direct access on x86, but like you, it's been a looooonnng time. Trivia: HP used a 4-bit processor in it's calculators for a long time.
Each address referred to a 4-bit nibble. They used this type of processor or an emulator of it right up through the HPg which was recently discontinued.
The HPC, which has been in continuous production for something like 30 years, still uses it, although via an emulator. I didn't know that about it. A new-in-box 11C might be more valuable than you think. If you ever want to sell it, pop over to hpmuseum. That's where all the HP calculator nerds hang out :. Mar 25, at am UTC. I don't think any amount would part me with that thing. You can't get a decent RPN C Jitter - Coeval - Nibbles anymore.
I could let the 15 go, but never an So he brought them home. All but the one 11 are effectively new. Maybe I can retire now lol, sitting on a gold mine.
Deep In My Heart (Extended Mix) - Club House - Deep In My Heart, IV Finale: Allegro Con Spirito - Haydn*, The Aeolian String Quartet* - The Complete String Quartets, Interview Marvin Gaye + Extrait de Can I Get A Witness - Various - The Motown Story 1959-1998, Walk With Me - Neverlution - Walk With Me, Fool For Love - Belinda Carlisle - Heaven On Earth