AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Substring an bestimmter Position im String?
Thema durchsuchen
Ansicht
Themen-Optionen

Substring an bestimmter Position im String?

Ein Thema von 3_of_8 · begonnen am 3. Aug 2006 · letzter Beitrag vom 4. Aug 2006
Antwort Antwort
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#1

Re: Substring an bestimmter Position im String?

  Alt 3. Aug 2006, 21:42
Funktioniert, aber wie kriege ich das Case Insensitive? Ich weiß nicht, wir man in Assembler Funktionen aufruft. (Also Parameter übergibt)

Meine Idee wäre jetzt sowas gewesen:
Ich rufe AnsiLowerCase auf, denn substr steht in eax.
Dann pushe ich eax auf den Stack und lade edx (wo s steht) nach eax, rufe wieder AnsiLowerCase auf und lade eax nach edx.
Dann poppe ich eax wieder runter.
Gibt nur ne AV. Warum? Was mache ich falsch?
Delphi-Quellcode:
function StrAtPos(substr, s: string; p: integer): boolean;
asm
         call AnsiLowerCase
         push eax
         mov eax, edx
         call AnsiLowerCase
         mov edx, eax
         pop eax
         push edi
         push esi
         test eax,eax
         je @Fail
         test edx,edx
         je @Fail
         test ecx,ecx
         jne @1
         mov ecx,1
@1: mov esi,eax
         lea edi,[edx+ecx-1]
         mov eax,ecx
         mov ecx,[esi-4]
         test ecx,ecx
         je @Fail
         lea eax,[eax+ecx-1]
         cmp eax,[edx-4]
         jbe @Cmp
@Fail: xor eax,eax
         jmp @End
@Cmp: mov edx,ecx
         shr ecx,2
         repe cmpsd
         jne @SetRes
@Bytes: mov ecx,edx
         and ecx,3
         repe cmpsb
@SetRes: sete al
@End: pop esi
         pop edi
end;
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  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 22:06 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