* * *

Author Topic: How does one write assembly code in Lazarus??  (Read 2571 times)

4joey1

  • Newbie
  • Posts: 3
How does one write assembly code in Lazarus??
« on: August 31, 2007, 03:45:21 pm »
Hallo!I am Lazarus Programming language newbie but with previous experience of using Borland Derlphi in Windows.

I have been trying to write assembly codes in Lazarus projects with little success.From my Delphi experience ,I have constantly the possibility to switch in Assembly(ASM) mode by typing as below:


General Template

asm
... my assembly instructions...
end;

Example code that runs in Delphi

  procedure TDIBUltra.RotateStyle (n : Byte); assembler;
    asm    // turn around the mask (N Modulo 32) times
      MOV  CL, n
      ROL  [Self].Mask, CL
    End;

How can I write assembly code that will run in Lazarus installed in Linux?Please respond to my request as soon as possible with a syntax of such a code.Thanks in advance.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2626
    • My Lazarus wiki user page
RE: How does one write assembly code in Lazarus??
« Reply #1 on: August 31, 2007, 05:01:03 pm »
Probably the same as in Delphi, with one difference. FPC uses AT&T syntax by default, but you can change to intel syntax using the -Rintel compiler switch.

Bart

  • Hero Member
  • *****
  • Posts: 794
    • Bart en Mariska's Webstek
How does one write assembly code in Lazarus??
« Reply #2 on: September 01, 2007, 12:08:34 pm »
Or, for Intel only, this is what the docs say about $ASMODE compiler directive:http://www.freepascal.org/docs-html/prog/progsu2.html#x9-70001.1.2

Bart

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads