AGB  ·  Datenschutz  ·  Impressum  







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

What's incorrect here

Ein Thema von mohfa · begonnen am 23. Jun 2009 · letzter Beitrag vom 23. Jun 2009
Antwort Antwort
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

What's incorrect here

  Alt 23. Jun 2009, 19:38
Hi , Could someone correct me this Code :
I get the Compiler Error : Operand Size Mismatch in : LDS SI,Path

Delphi-Quellcode:
var
LFNError: word;

function ASCIZToString (ASCIZ: array of Char): String;
begin
ASCIZToString := StrPas (@ASCIZ);
end;
/////
function FindFirst (Path: String; Attr: word; var F: FindData): word;assembler;
asm
  mov LFNError, 0
  push ds
  LDS SI,Path // ----> Operand Size Mismatch
  mov dx, si
  inc dx
  mov cl, [si]

@@StringToPChar:
  inc si
  dec cl
  jnz @@StringToPChar

  inc si
  mov byte ptr [si], 0

  les di, F // ----> Operand Size Mismatch

  mov cx, Attr
  mov ax, 714Eh
  mov si, 1

  int 21h
  pop ds
  jnc @@NoCarry

  mov LFNError, ax
  jmp @@Exit

@@NoCarry:
cmp ax, 7100h
  jne @@Exit

  mov LFNError, ax

@@Exit:
end;

procedure FindNext (var F: FindData; FileFindHandle: word); assembler;
asm
  mov LFNError, 0
  mov ax, 714Fh
  mov si, 1
  mov bx, FileFindHandle
  les di, F// ----> Operand Size Mismatch

  int 21h

  jnc @@NoCarry

  mov LFNError, ax
  jmp @@Exit

@@NoCarry:
cmp ax, 7100h
  jne @@Exit

  mov LFNError, ax

@@Exit:
end;

procedure FindClose (FileFindHandle: word); assembler;
asm
  mov LFNError, 0

  mov ax, 71A1h
  mov bx, FileFindHandle

  int 21h

  jnc @@NoCarry

  mov LFNError, ax
  jmp @@Exit

@@NoCarry:
cmp ax, 7100h
  jne @@Exit

  mov LFNError, ax

@@Exit:
end;
and just wondering is this fast than using the Delphi TSearchRec ....

many thanks
  Mit Zitat antworten Zitat
Apollonius

Registriert seit: 16. Apr 2007
2.325 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: What's incorrect here

  Alt 23. Jun 2009, 19:46
Very funny indeed. This code is probably designed for DOS as it directly uses interrupts and assumes a 16-bit processor (there have been 64-bit processors out there for quite a while now).
Wer erweist der Welt einen Dienst und findet ein gutes Synonym für "Pointer"?
"An interface pointer is a pointer to a pointer. This pointer points to an array of pointers, each of which points to an interface function."
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.142 Beiträge
 
Delphi 12 Athens
 
#3

Re: What's incorrect here

  Alt 23. Jun 2009, 19:48
Delphi 7 creates 32-bit-Code and this ASM-Codes are 16 bit.


And INT 21 is under WinNT also not easily possible.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: What's incorrect here

  Alt 23. Jun 2009, 19:58
So ,Should i forget to use it with Delphi7 ??
and no possiblity to correct it ?
  Mit Zitat antworten Zitat
Apollonius

Registriert seit: 16. Apr 2007
2.325 Beiträge
 
Turbo Delphi für Win32
 
#5

Re: What's incorrect here

  Alt 23. Jun 2009, 20:02
Forget it. This code won't lead to anything on Windows with Delphi.
Wer erweist der Welt einen Dienst und findet ein gutes Synonym für "Pointer"?
"An interface pointer is a pointer to a pointer. This pointer points to an array of pointers, each of which points to an interface function."
  Mit Zitat antworten Zitat
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: What's incorrect here

  Alt 23. Jun 2009, 20:08
Zitat von Apollonius:
Forget it. This code won't lead to anything on Windows with Delphi.
MANY THANKS Apollonius and for all of you

[Closed]
  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 06:01 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz