위키 사본미러

이곳은 pascal.chat 위키의 미러입니다. 편집, 기록, 로그인은 그곳에서 할 수 있습니다.

Lazarus Inline Assembler/ko

한국어 · English · Español · Français · Tiếng Việt · Русский · 日本語

이것은 다른 사람들이 많은 기여를 할 수 있게하는 역활을 하게 하려고 한 것이다. 다음은 시작하깅 아주 간단한 예제이다:

pascal
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);
  //이것은x86 상에서 라자루스가 있어야한다.
  {$ASMMODE intel}
  asm//이진수 110을 더한다//십진수 2를 뺀다
    MOV EAX, num
    ADD EAX, 110B //이진수 110을 더한다
    SUB EAX, 2    //십진수 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/ko", 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.

1판, 마지막 편집: WikiArchive .