Recent

Author Topic: ASM bug or error ?  (Read 6680 times)

sxb

  • New member
  • *
  • Posts: 8
ASM bug or error ?
« on: February 19, 2010, 05:00:32 pm »
Hello all
I cant seem to get ASM working in OS-X. Is there a difference in syntax compared to regular Delphi or is something else happening here ?
 
I get an error message : "unit1.pas(33,3) Fatal: Selected assembler reader not supported"
-----------------
function getanum(x: Integer): Integer;
begin
  asm
    add eax, eax
  end;
end;

Thanks for any pointers on this

Regards
soumi

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2663
Re: ASM bug or error ?
« Reply #1 on: February 19, 2010, 06:18:32 pm »
I think only AT&T style asm is supported. Further I would use plain pascal and skip asm. I cannot guarantee that the same registers are used on windows and osx 
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Silvio Clécio

  • Guest
Re: ASM bug or error ?
« Reply #2 on: February 19, 2010, 07:19:02 pm »
Please, try:

// {$mode objfpc}{$H+} Remove

{$mode delphi} // Add

function getanum(x: Integer): Integer;
begin
  asm
    add eax, eax
  end;
end;

I have not tested. :-[

sxb

  • New member
  • *
  • Posts: 8
Re: ASM bug or error ?
« Reply #3 on: February 20, 2010, 06:33:52 am »
Thanks Marc and Silvio

BTW, the {$mode delphi} worked .... :)

Regards
Soumi

 

TinyPortal © 2005-2018