![]() |
What's incorrect here
Hi , Could someone correct me this Code :
I get the Compiler Error : Operand Size Mismatch in : LDS SI,Path
Delphi-Quellcode:
and just wondering is this fast than using the Delphi TSearchRec ....
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; many thanks |
Re: What's incorrect here
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).
|
Re: What's incorrect here
Delphi 7 creates 32-bit-Code and this ASM-Codes are 16 bit.
And INT 21 is under WinNT also not easily possible. |
Re: What's incorrect here
So ,Should i forget to use it with Delphi7 ??
and no possiblity to correct it ? |
Re: What's incorrect here
Forget it. This code won't lead to anything on Windows with Delphi.
|
Re: What's incorrect here
Zitat:
[Closed] |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:48 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 by Thomas Breitkreuz