Ok, then this can be this way:

procedure increment(var x: dword); assembler;
asm
   mov eax, x
   inc [eax]
end;

Is this correct? If the compiler uses registers, the first line is translated to a 'mov eax, eax', otherwise it is something like 'mov eax, [esp-4]'.

Regards,

Nelson

The asm block can be this way:

procedure increment(var x: dword); assembler;
asm
   inc [eax]
end;

You don't need to worry about segment registers, but don't mess with them!
I assume that the parameter x is passed on the eax register as Delphi does.
Please correct me if I'm wrong...

You are wrong.

He is using 1.0.x, which doesn't have register parameters. That is 1.9.2 or
1.9.4+



_______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal




_______________________________________________ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to