Thanks to everybody for their comment.<br><br>My own comment is mere suggestion.<br><br>As x86 developer, i'm used to manipulating bits with byte-wise or/and/not/shr/shl operators. (very tricky when doing PDU packing for 7 bit words into 8 bit words for some GSM coding schemes)<br>
<br>As far as endian is concerned: Integer types i found always to be little endian in most pascal compilers by default. To do big endian (network byte order) transport for some protocols or file formats, i used the htonl and htons lib functions on the integer fields. I wrote htonl_64 myself for 8 byte width integers.<br>
<br>As far as the FPC compiler is concerned, this should not be a concern as it seems the decisions regarding the byte order was made and cemented in place long ago. But now that you guys mention byte order, are there directives in FPC where integer byte orders can be changed?<br>
<br>If language syntax might be extended to provide bit width accessibility for MCU's, i think the same methods must be followed throughout FPC: In all technical specifications I have come accross, bit 0 is always the least significant bit of any word regardless the size of the word. That makes things simple.<br>
<br>As for the way the syntax will work, I can only suggest sticking with pascal as close as possible. It's a fantastic language.<br><br><div class="gmail_quote">On Thu, Jul 30, 2009 at 10:15 AM, Marco van de Voort <span dir="ltr"><<a href="mailto:marcov@stack.nl">marcov@stack.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">In our previous episode, Desmond Coertzen said:<br>
> No use for OS, just for smaller MCU's that are bit accessible.<br>
<br>
> By application I meant: Is this the correct method to apply a bit-packed<br>
> structure to code?<br>
<br>
</div>Note that there are two kinds of bitaccessibility.<br>
<br>
E.g. microchip follows more the bitpacked way, where all SFR are overlayed<br>
(ABSOLUTE in FPC) with a bitpacked union in the header.<br>
<br>
In addition some mcu's like IIRC 8051 (*) allows to access ANY integer/byte<br>
value to be accessed using .<bitnr> suffix. So if b is of type byte, b.7<br>
returns the 7th bit. It also had a special type bit to store these and do<br>
some limited arithmetic on them. Probably mapping directly on some bit sized<br>
registers/flags and instructions.<br>
<br>
(*) iirc we had some Hitachi clone 80515 or so. The compiler was the fairly<br>
wellknown Keile one.<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a><br>
</div></div></blockquote></div><br>