[fpc-devel] asm offset question
    ABorka 
    fpc-devel at aborka.com
       
    Sat Nov  8 11:23:48 CET 2008
    
    
  
Hi,
I'm converting a Delphi program to FPC/lazarus and I did hit a snag with 
an asm code part (win32, latest fpc and lazarus svn trunk is used).
I know it is probably simple to fix, but I cannot seem to be able to 
figure it out:
function something(s :String; i: Integer):String;
var tmp:Array[0..32768]of byte;
begin
.
.
{$ASMMODE intel}
     asm
       pushad
       mov edi, offset tmp
       add edi, ebp
.
.
       popad
     end;
end;
The compiler gives "Error: Cannot use local variable or parameters here" 
at line "mov edi, offset tmp" .
How can I get the offset of a local variable into a register?
Thanks for any help.
    
    
More information about the fpc-devel
mailing list