[fpc-pascal]Default calling convention
Marcel Martin
mm10 at ellipsa.net
Sun Jul 4 04:12:03 CEST 2004
Florian Klaempfl a écrit :
>
> Thomas Schatzl wrote:
> >
> > In this case
> >
> > procedure nx_fill(P: PLongword; Count: Longint; Value: Longword);
> > assembler;
> > asm
> > pushl %edi
> > movl P,%edi // edi <- P
> > movl Value,%eax // eax <- Value
> > movl Count,%ecx // ecx <- Count
> > rep
> > stosl
> > popl %edi
> > end;
> >
> > works both as embedded and non-embedded assembler procedure because the
> > order of assignments is ok in both cases.
> >
> > Btw, there's already a method in the system unit which does the same
> > thing as your routine: filldword()...
>
> ... and with better instruction selection ;)
1) This little routine was sent to point out a problem.
2) Better than what? Where do you see an "instruction selection"
in my procedure. There is none. And there is none because this
is useless. 'nx_fill' is in a unit called 'nxkernel', this unit
contains all the low level routines for the library, and with these
routines, it is up to the calling procedures to check the validity
of the transmitted parameters. This is as simple as that.
--
mm
http://www.ellipsa.net/
More information about the fpc-pascal
mailing list