Memory layout of a data structure: Difference between revisions

m
Line 720:
bits[DTR] = 1
poke2(addr,bits_to_int(bits))</lang>
Naturally, you would be well advised to sequester such grubby details away in a small and separate unit/source code file (eg RS232.e) with a domain specific public API that does not leak implementation details (eg keep those constants private). There are 1/2/4/8 byte variants of peek and poke, and int-to-bits can extract anything from 1 to 53 bits on a 32-bit runtime, or up to 64 on a 64-bit runtime.
Alternatively you cancould use bit-masks, or it may be possible to enhance builtins/cffi.e to manage bit-fields, then again the above C entry does not exactly inspire confidence.
 
=={{header|PicoLisp}}==
7,803

edits