Recent

Author Topic: Does not wince support Embedded assembler?compile wince program but the funvtion  (Read 8647 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: 76
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

  • Administrator
  • Hero Member
  • *
  • Posts: 11384
  • FPC developer.
@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

 

TinyPortal © 2005-2018