[fpc-pascal] ARM-Cortex port

Thomas Schatzl tom_at_work at gmx.at
Tue Aug 24 12:07:41 CEST 2010


Hi,

On Tue, 24 Aug 2010 10:53:55 +0100, Geoffrey Barton <mrb at periphon.net>
wrote:
>>
>> Date: Mon, 23 Aug 2010 13:57:30 -0300
>>  Thanks Jonas and Jeppe for your answers. I will probably wait then to
>> switch (or try to convince the company to use an ARM-9)
> 
> using Jonas and Jeppe's answers to my idiot questions in this forum,  
> and Jeppe's startup code for the STM32F, I have FPC cross-compiling  
> for the LM3S9B92, one of the TI Luminary processors. Getting  
> interrupts working took some time. I think the next thing for me is to  
> try calling the rom code from FPC. Then it should be possible to re- 
> use all the library of C code supplied by TI and it will no longer be  
> necessary to try and fathom lines such as:-
> 
> *((void (*)(void))(*(unsigned long *)0x2c)))();
> 
> which occurs in the USB example code :-)
> I am not quite sure how to write that in FP, but I am sure someone  
> will have an idea.

Something like this should work for that case:

type
  TMyProcedure = procedure;
// if the procedures/functions you want to invoke have parameters
// use something like this:
//
// TMyFunction = function(arg1 : type1; arg2 : type2) : result_type;

var
  x : TMyProcedure;

begin
  x := TMyProcedure(0x2c);
  x;  // to invoke it. Or "x()" if you prefer that
end.

Hth,
  Thomas




More information about the fpc-pascal mailing list