I've been able to get back into the assembler a bit more for various reasons. Anyhow, I'm still learning and I found something I would like some advice on.
In converting this Pascal code, the thing I struggled with was the typecasting parts. Now I'm fine with the DWord typecast for most part ( XOR E?X, E?X then move byte to ?L ).
Now the Byte typecast was a little bit more trouble because I needed the lower byte of that result ( ?L ) to address the array represented by CRC32tab. I figured it out by using 3 or 4 instructions to clear the high 24-bits of the extended register.
But the question is this: Is there a better way to approach this problem?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
Code:
crc32_out := CRC32tab[Byte(crc32_out xor DWord(PChar(inbuffer)^))] xor
((crc32_out shr 8) and $00ffffff);
In converting this Pascal code, the thing I struggled with was the typecasting parts. Now I'm fine with the DWord typecast for most part ( XOR E?X, E?X then move byte to ?L ).
Now the Byte typecast was a little bit more trouble because I needed the lower byte of that result ( ?L ) to address the array represented by CRC32tab. I figured it out by using 3 or 4 instructions to clear the high 24-bits of the extended register.
But the question is this: Is there a better way to approach this problem?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.