Board index » delphi » Operand Size Mismatch

Operand Size Mismatch

This is part of the strings.pas that came with my delpi 2 program...
anyways I always get the same error when I try to compile anything that
contanins the string.pas in the Uses line...  the error that I always
get is 'Operand Size Mismatch' how do I fix this problem?? any Ideas
helpful...

function StrLen(Str: PChar): Word; assembler;
asm
        CLD
        LES     DI,Str  <---This is the line that always causes the error...
        MOV     CX,0FFFFH
        XOR     AL,AL
        REPNE   SCASB
        MOV     AX,0FFFEH
        SUB     AX,CX
end;

Above in the asm code is the thing that always gives me an error the
other one that causes the same error in the code is the one that starts
with the SI instead of the DI....

Please help thanks...

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
          Michael Wakkinen
          -=-=-=-=-=-=-=-=
Sysop Of Thrill Seekers 406-728-1276
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 

Re:Operand Size Mismatch


In message <321AA36E.6...@selway.umt.edu>, wacky2 <wac...@selway.umt.edu> said:

Quote
> This is part of the strings.pas that came with my delpi 2 program...
> ...
> function StrLen(Str: PChar): Word; assembler;
> asm
>    CLD
>    LES     DI,Str  <---This is the line that always causes the error...

< ...

Delphi 2 is 32-bit. That assembler code is 16-bit. They don't mix well.

For whatever reason, you're attempting to recompile the wrong code.

-----------------------------------------------------------------------
Steve Rencontre               |  st...@dstrip.demon.co.uk (business)
If it works, it's obsolete.   |  steve...@cix.compulink.co.uk (private)
-----------------------------------------------------------------------

Other Threads