Thema: Delphi What's incorrect here

Einzelnen Beitrag anzeigen

mohfa

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

What's incorrect here

  Alt 23. Jun 2009, 20: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