Re: Inline assembler syntax error in Delphi 2006



xor al, dword ptr [cCRC32Table + ebx]

When I tried your first solution , I get Operand type mismatch error.

Oops, should've been

xor al, byte ptr [cCRC32Table + ebx]

Please do help me on this.
Can you tell me what is the difference b/w
xor eax, DWORD [cCRC32Table][EBX*4] // Result:=eax xor Table[ebx]

Xor DWORD with element from array of DWORD

xor eax, DWORD [cCRC32Table][EBX]
// Result:=eax xor TByteArray(Table)

Xor DWORD with four elements from array of BYTE, cast to DWORD

and your second solution(
xor eax, dword ptr [cCRC32Table + ebx * 4]) denotes
// Result:=eax xor Table[ebx]

Xor DWORD with element from array of DWORD

Note that you're still using the [cCRC32Table][EBX*4] notation which is
weird and wrong. I'm surprised it compiled on Delphi 5. I assume it
denotes [cCRC32Table + EBX*4], which would be consistent with what this
seems to be meant for.

--
The Fastcode Project: http://www.fastcodeproject.org/
.