Lazarus inline assembler
한국어 · English · Español · Français · Tiếng Việt · Русский · 日本語
This is a stub to encourage others to contribute further. Here is a very simple example to get started:
unit unt_asm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
btnGo: TButton;
edtInput: TEdit;
edtOutput: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure btnGoClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.btnGoClick(Sender: TObject);
var
num, answer : integer;
begin
num := StrToInt(edtInput.Text);
//This is required with Lazarus on x86:
{$ASMMODE intel}
asm//add binary 110//subtract decimal 2
MOV EAX, num
ADD EAX, 110B //add binary 110
SUB EAX, 2 //subtract decimal 2
MOV answer, EAX
END;
edtOutput.Text := IntToStr(answer);
end;
initialization
{$I unt_asm.lrs}
end.From the Free Pascal wiki, page "Lazarus inline assembler", as it stood on 2020-02-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Edited on wiki.freepascal.org by 9 people, 2008–2020
From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.
| When | Who | What changed |
|---|---|---|
| Normanp | New page: = Lazarus Inline Assembler = This is a stub to encourage others to contribute further. Here is a very simple example to get started: <pre> Code here </pre> | |
| Normanp | Lazarus Inline Assembler (minor) | |
| Normanp | ||
| Normanp | New page: This is a stub to encourage others to contribute further. Here is a very simple example to get started: <pre> unit unt_asm; {$mode objfpc}{$H+} interface uses Classes, SysUtils, LResourc... | |
| GMorris | ||
| GMorris | ||
| Paulatreides | ||
| Chronos | ||
| Chronos | code highlight | |
| Vincent | Text replace - "delphi>" to "syntaxhighlight>" (minor) | |
| Chronos | ||
| Jwdietrich | Categorization | |
| HowardPC | (minor) | |
| Bart | fix syntax highlighting | |
| Trev | Fixed syntax highlighting (minor) |
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
