Difference between revisions of "Lazarus Inline Assembler/ko"

From Lazarus wiki
Jump to navigationJump to search
m (Fixed syntax highlighting; deleted category included in page template)
 
Line 2: Line 2:
  
 
이것은 다른 사람들이 많은 기여를 할 수 있게하는 역활을 하게 하려고 한 것이다. 다음은 시작하깅 아주 간단한 예제이다:
 
이것은 다른 사람들이 많은 기여를 할 수 있게하는 역활을 하게 하려고 한 것이다. 다음은 시작하깅 아주 간단한 예제이다:
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
unit unt_asm;
 
unit unt_asm;
 
{$mode objfpc}{$H+}
 
{$mode objfpc}{$H+}
Line 50: Line 50:
  
 
* [[VirtualTreeview Example for Lazarus]]
 
* [[VirtualTreeview Example for Lazarus]]
 
[[Category:Tutorials/ko]]
 

Latest revision as of 00:16, 19 February 2020

English (en) español (es) français (fr) 日本語 (ja) 한국어 (ko) русский (ru) Tiếng Việt (vi)

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

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
    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.

더 볼 것