I'm trying to implement a function StrPos in assembler. I have 64-bit processor and FPC. When I'm compiling this shows the following errors:
function StrPos(Str1, Str2: PChar): LONGINT; assembler;
asm
PUSH DS
CLD
XOR AL,AL
LES EDI,Str2 // error: asm: [les reg32, reg32] Invalid combination of opcode and operands
MOV CX,0FFFFH
REPNE SCASB
NOT CX
DEC CX
JE @@2
MOV DX,CX
MOV BX,ES
MOV DS,BX
LES EDI,Str1 // error: asm: [les reg32, reg32] Invalid combination of opcode and operands
// .........
end;
Please, help me