Re: Inline assembler syntax error in Delphi 2006
- From: Nicholas Sherlock <N.sherlock@xxxxxxxxx>
- Date: Thu, 29 Jun 2006 23:09:54 +1200
Menaka wrote:
When I tried your first solution , I get Operand type mismatch error.
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]
and xor eax, DWORD [cCRC32Table][EBX] // Result:=eax xor TByteArray(Table)
and your second solution(xor eax, dword ptr [cCRC32Table + ebx * 4]) denotes // Result:=eax xor Table[ebx] Please explian
What exactly is your array? Array of integer? Array of Longword? Array of byte? Assuming that it is an array of 32-bit quantities.
xor eax, DWORD [cCRC32Table][EBX*4]
This is bizarre syntax. If Delphi knows that you are trying to access array elements, then this is trying to XOR with the element of the array at index EBX*4.
xor eax, DWORD [cCRC32Table][EBX]
This is trying to xor with the element with index EBX. This is probably what you want, but the syntax is odd.
xor eax, dword ptr [cCRC32Table + ebx * 4]
This XORs with the element with index EBX, if the array cCRC32Table is an array of 32-bit (ie. 4 byte) quantities. This is probably what you want. (All the CRC32 tables I have come across are arrays of 4-byte quantities, IIRC).
Cheers,
Nicholas Sherlock
--
http://www.sherlocksoftware.org
.
- References:
- Re: Inline assembler syntax error in Delphi 2006
- From: Avatar Zondertau
- Re: Inline assembler syntax error in Delphi 2006
- From: Avatar Zondertau
- Re: Inline assembler syntax error in Delphi 2006
- Prev by Date: Re: Inline assembler syntax error in Delphi 2006
- Next by Date: Re: Inline assembler syntax error in Delphi 2006
- Previous by thread: Re: Inline assembler syntax error in Delphi 2006
- Next by thread: Re: Inline assembler syntax error in Delphi 2006
- Index(es):
Relevant Pages
|