Recent

Author Topic: Does not wince support Embedded assembler?compile wince program but the funvtion  (Read 4119 times)

dorry

  • New Member
  • *
  • Posts: 12
anyone can help me test?compile wince program but the funvtion failure? does not wince support Embedded assembler?
function add(x, y: Integer): Integer;
thanks!
var count: Integer;
begin
     asm
        MOV EAX, x     
        MOV ECX, y     
        ADD EAX, ECX   
        MOV count, EAX 
     end;
     Result := count;   
   
end;

A.S.

  • Jr. Member
  • **
  • Posts: 74
What target processor do you use? If you compile for arm-wince you should use
ARM assembler instruction (in at&t syntax).

dorry

  • New Member
  • *
  • Posts: 12
@A.S. ,yes ,it is ARM CPU, can you write above function example code?
thanks!

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7430
@A.S. ,yes ,it is ARM CPU, can you write above function example code?

No, that is intel assember, ARM works differently, and worse, is fragmented over multiple generations.

Best to work through a book or tutorial first. (google arm assembly tutorial or so).

Then you can start looking at the assembler FPC generates (using -al) and then try to optimize it