[fpc-devel] Freepascal in microcontrollers

Marco van de Voort marcov at stack.nl
Wed Feb 27 10:44:35 CET 2008


> Op Wed, 27 Feb 2008, schreef Marco van de Voort:
> 
> > function ByteIO(var p):puchar; inline;
> >
> > begin
> >  result:=puchar(@p);
> > end;
> 
> > const port = puchar(_port); // !??!?
> > port^:=$55;
> 
> Nope, don't forget that we have a nice arsenal of constructs to do system 
> programming, like the mem array, the port array, absolute etc. The above 
> can be replaced by:
> 
> mem[_port]:=$55;

I know, but I thouht it was mainly about the typing. Most importantly that
you can access this bitwise using e.g. ptrs to bitpacked arrays. One sees
this a lot in embedded C too.



More information about the fpc-devel mailing list