-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need support for splitting an integer. #27
Comments
One approach that seems reasonably elegant is to have So the
The macro would detect the presence of |
I've found another real-world data format that splits integers across non-adjacent bytes. The x86 architecture's global descriptor table is described on page 38 here: https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf |
Perhaps a more readable syntax would be to give the fragments numbers instead of
The primary variable would have a This scheme would be inadequate if there was an array that interleaved fragments of its elements. |
Consider the EDID format used by HDMI monitors: https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#EDID_1.4_data_format
Part of this spec calls for an integer whose lowest 8 bits are followed by the lowest 8 bits of an unrelated integer, followed by the highest 4 bits of the first integer, then the highest 4 bits of the second integer.
Something like this:
I've seen other formats that do things like this (but never an explanation of why someone would do
this), so perhaps there should be some way to specify that REST-OF-NUMBER-OF-FROBS is part of NUMBER-OF-FROBS (and which part it is in that case, since someone could specify a format in which the chunks are laid out in middle-endian order).
The text was updated successfully, but these errors were encountered: