首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

为何地址数据不对解决方案

2012-04-05 
为何地址数据不对procedure ShowX(i:integer)beginform1.Memo1.Lines.Add(IntToStr(i))endfunction Rle

为何地址数据不对
procedure ShowX(i:integer);
begin
  form1.Memo1.Lines.Add(IntToStr(i));
end;
function RlenX(a,b:pinteger):integer;
asm
  //为何A,B地址不对
  sub eax,edx

end;
procedure abc(px:pchar);
asm
  //eax edx
  // mov edx,eax

  mov ecx,eax-4
  mov esi,eax
  mov edi,eax
  @@1:
  push edi
  push esi
  call rlenx
  cmp eax,ecx

  push eax
  call showx
  jl @@1
  popad
 // sub esi,edi

end;
procedure TForm1.Button2Click(Sender: TObject);
begin
  abc (p1);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  s:='0123456789';
  p1:=pchar(s);

[解决办法]
本身的调用方式就不对 

DELPHI 中 利用 EAX EDX 传送数据
mov eax,edi
mov edx,esi
call rlenx

热点排行