[fpc-pascal] syscalls and fpc

ik idokan at gmail.com
Fri Feb 15 20:50:33 CET 2008


On Fri, Feb 15, 2008 at 8:36 PM, Micha Nelissen <micha at neli.hopto.org> wrote:
> ik wrote:
>  > Actually the assembler is not that hard to understand :)
>  > My point is, that I don't like the idea of 7 or 20 or 100 amount of
>  > parameters to give answer to every need. I think we should find a
>  > better way to implement it, like var args in C or open array in
>  > pascal...
>
>  The linux kernel interface is always using registers, and since there
>  are a limited amount of registers, there is a max. number of arguments.
>  IIRC the maximum is 6, i386 limited: eax, ebx, ecx, edx, esi, edi, ebp.

You are welcome to correct me if I wrong, but can't I use prameters as follows:

push param1
push param2
push param3
....
push paramX
call syscall

?

If so, then I don't think there is a specific need for using the eax,
ebx registers etc..
Please look at the C deceleration of the syscall:
int syscall(int number, ...);


It uses var_args, and therefor 6 registers are not enough imho...
because tomorrow some one can add new call with 10 params, and then
what ? I can't find any documentation that limit the amount of
parameters that can be given to the function (at least in Linux, maybe
POSIX/BSD/Solaris/Other have different rules)

>  Micha


Ido
-- 
http://ik.homelinux.org/



More information about the fpc-pascal mailing list