Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-12

What does the "register" keyword do?

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sooky Boo

Hi,

I am wondering what the register keyword does, I am hoping that it is the same as the c++ register keyword.

In c++ the register keyword tries to make the compiler use the CPU's registers if possible for the variable being defined.

If anyone knows what the register keyword does and how it is used please let me know.

I could use "asm" and use the registers myself but its not cross platform compatible.

Thanks

Reply by email

Felipe Monteiro de Carvalho
to Sooky Boo

register is the name of a calling convention which uses registers when possible for function parameters.

The register keyword defines that the routine uses this calling convention, but it normally isn't used because this is the default calling convention.

Felipe Monteiro de Carvalho

Reply by email