|
发表于 2012-11-29 23:23:08
|
显示全部楼层
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons;
- type
- TForm1 = class(TForm)
- btn1: TBitBtn;
- edt1: TEdit;
- procedure btn1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- var dj:Integer=0;
- {$R *.dfm}
- procedure dh (var i:string);
- begin
- asm
- mov ebx,0
- mov ecx,0ffffh
- mov ebx,i
- mov esi,[ebx]
- @s:mov al,[esi+1]
- cmp al,0
- je @ok
- xchg al,[esi]
- mov 1[esi],al
- add esi,2
- loop @s
- @ok:nop
- end;
- end;
- procedure TForm1.btn1Click(Sender: TObject);
- var
- s:string;
- i:byte;
- begin
- s:=Trim(edt1.Text);
- dh(s);
- edt1.Text:=s;
- end;
- end.
复制代码
|
|