Operand size mismatch




Hi,

I came across to a recent delphi lib claiming the world.

But, the trouble is, I can not compile it as I keep getting
'Operand Size Mismatch' errors.

There a few routines that this comes up, here is one (I have
marked the position)

function _cCharPos_old(const Ch: Char; const S: string; const StartPos: integer = 1): integer; assembler
asm
@@Start: push esi
test S, S; jz @@zero // check S length
mov esi, S.SzLen
cmp StartPos, esi;
jle @@begin
@@zero: xor eax,
eax; jmp @@Stop
@@begin: push S
sub StartPos, esi;
add S, esi
@_Loop:
cmp al, S[StartPos-1]; { <--- ERROR HERE}
je @@found
inc StartPos; jle @_Loop
@@notfound: xor eax, eax;
jmp @@end
@@found: sub S, [esp];
lea eax, S + StartPos
@@end: pop S
@@Stop: pop esi
end;


Could someone correct this.

VTW, my CPU is Opteron on Win2003 Server.

--

Cheers,
Adem
.



Relevant Pages

  • Re: f0dders fabulous follies (Library Design)
    ... amount of bytes passed in EAX. ... push dword 0; dwFlags ... xor esi, esi ... mov edi, esi ...
    (alt.lang.asm)
  • St0ToAscii
    ... ; eax St0ToAscii(char* string); ... in eax il numero di caratteri scritti usa due registri float ... mov esi, @string ... WM_DESTROY equ 2h; WM_CLOSE equ 10h; WM_NCPAINT equ ...
    (alt.lang.asm)
  • TheExEcutor Class A v1.0 - Special Win32 Shellcode
    ... add eax, ebx;eax = ptr to export tables ... xor ecx, ecx ... push word ptr ... push esi ...
    (Vuln-Dev)
  • TheExeCutor v2.0 A PRE Release
    ... mov ecx, CODE_LEN ... "esi" points to the beginning of the variables. ... cmp, dword ptr 'EKIK' ... mov eax, dword ptr ...
    (Vuln-Dev)
  • New System Functions
    ... test eax, eax ... mov.StrRec.length, edx ... mov esi, edx ... mov ecx,.StrRec.length ...
    (borland.public.delphi.language.basm)