On 11/08/2013 07:46 PM, Martin Schreiber wrote:
>
> One probably would write
> "
> Register = bitpacked RECORD
> Field_1: $0000..$007f;
> Field_2: $0000..$0003;
> Field_3: $0000..$001f;
> Field_4: $0000..$0001;
> Field_5: $0000..$0001;
> END;
> "
Why not something like
bitpacked RECORD
Filed_1: integer: 7;
Filed_2: integer: 2;
Filed_3: integer: 5;
Filed_4: integer: 1;
Filed_5: integer: 1;
end
Pro 1: It defines the way operations on the fields are to be executed
(here signed integer, or whatever basic type mselang will define for
this, but of course could be unsigned integer or whatever). IMHO this is
strictly necessary to allow for predictable calculations with such fields.
Pro 2: This is not limited on a single hardware "Word", but can define
to arbitrary length memory areas.
Con 1: you need to add dummy fields if you intent to ignore some part of
the bits (no real problem IMHO)
Con 2: the bit position is implementation dependent (should be done like
GNU C does this). A decent documentation might help. I doubt that
MSElang ever will exist for high-byte first languages, so the
distinction GNU C does on this behalf is not relevant.)
-Michael
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk