[fpc-pascal]FPC 1.9.x assembler register conventions

paradice lawrence at paradicesoftware.com
Fri May 7 07:27:36 CEST 2004

Hi everyone -

I'm currently somewhere near the beginning of porting all my assembler code
to the Register calling mechanism, but I have a couple of questions I
haven't managed to find the answers to online - can anyone help?

1. What registers do we have to preserve when leaving the assembler
function? (for normal functions and for class methods) From some early
testing it seems not preserving EBX can cause problems (signalling EBX has
changed doesn't seem to make any difference)...

2. What register can we assume values for when entering assembler functions?
(e.g. ESI always used to be "Self" for methods but it's now in EAX instead..
is ESI free to use these days?)

3. What's the most future-proof way of using $ifdef statements to guard my
assembler blocks? At the moment I'm using "$ifdef VER1_9" but this will
change when 2.0 is released... Does the compiler set a definition for the
default calling method that I can use?

Some early testing with my graphics units is showing that the register
calling has increased the speed of the methods I've converted by approx. 5%,
so good work guys!

Thanks very much
Lawrence Curwood

More information about the fpc-pascal mailing list