AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Assembler in Delphi! Speichersack?

Ein Thema von neolithos · begonnen am 30. Sep 2003 · letzter Beitrag vom 30. Sep 2003
Antwort Antwort
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: Unterhaching
11.413 Beiträge
 
Delphi 12 Athens
 
#1

Re: Assembler in Delphi! Speichersack?

  Alt 30. Sep 2003, 11:23
Das Ergebnis wird für Integer-Funktionen in EAX zurückgegeben, ansonsten kannst Du natürlich auch Result ansprechen, allerdings ohne die @ Operatoren

Code:
function TColorPalette.HitColorText(apt: TPoint): Integer;
var x : Integer;
{begin
  if PtInRect(ClientRect, apt) then
     if ((apt.x mod 17) > 14) or ((apt.y mod 17) > 14) then
        Result := -1
     else
        Result := (apt.x div 17) + (apt.y div 17) * 8
  else
     Result := -1;
end;}
asm
  // apt.x div 17
  mov eax, apt.x
  mov ecx, 17
  push edx
  mov edx, 0
  div ecx
  cmp edx, 14
  jns @nowhere
  mov x, eax
  // apt.y div 17
  pop edx
  mov eax, apt.y
  mov edx, 0
  div ecx
  cmp edx, 14
  jns @nowhere
  // Result := x + y(eax) * 8
  shl eax, 3
  or eax, x
  cmp eax, 40
  jns @nowhere
[color=#ff0000][s] mov @Result, eax[/s][/color]
  jmp @1
@nowhere:
  mov [color=#ff001b]EAX[/color], -1 // Result := -1
@1:
end;
......
Daniel Lizbeth
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz