[fpc-devel] Freepascal in microcontrollers

Vinzent Hoefler JeLlyFish.software at gmx.net
Wed Feb 27 12:17:15 CET 2008


On Wednesday 27 February 2008 11:47, Daniƫl Mantione wrote:

> Then use bitpacked records:

If you'd document them properly?

-- 8< --

type
   TX = 1 .. 4;
   TY = 0 .. 3;

type
   Foo = bitpacked record
      A : TX;
      B : TY;
   end {record};

var
   X : Foo;
begin
   X.A := 1;
   X.B := 2;
   WriteLn (X.A);
   WriteLn (X.B);
   WriteLn (SizeOf (X));
end.

-- 8< --

Free Pascal Compiler version 2.0.0 [2005/09/09] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for i386
Compiling test.pas
test.pas(6,10) Error: Identifier not found "bitpacked"

> type  TSDRAM_Buffer_Control=bitpacked record
>          {...}
>        end;
>
> var SDRAM_Buffer_Control:TSDRAM_Buffer_Control absolute [$xxxxxx];
>
> begin
>    {...}
>    SDRAM_Buffer_Control.WB_Watermark := Sixteen;
>    {...}
>
> Just like Micha I'm not impressed about the Ada code,

It wasn't meant to impress anybody. It was meant to show that there's no 
preprocessor needed.

> and it is off-topic, this is and remains a Pascal newsgroup.

Oh, I thought of it as a mailing list. ;)

> Comparisons 
> between Pascal and other languages are on-topic, comparisons between
> C and Ada are off-topic.

So we're on-topic again. You are comparing Pascal and Ada. I look at Ada 
as a more strict version of Pascal, is all. Too many Ada-features have 
crept into Pascal over the years. ;)


Vinzent.



More information about the fpc-devel mailing list