Re: [Dev-C++] Problem with __asm statement
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel K. O. <dan...@gm...> - 2007-02-17 16:32:18
|
Per Westermark escreveu:
> No, you do not want anyone to translate it to assembly for use with gcc.
>
Indeed, that doesn't look like the right solution. Gcc also accepts
Intel syntax, with -masm=intel, but it may still need some tweaking.
> They guy returned assembler code just to poke fun at you.
>
Hanlon's razor: "never attribute to malice that which can be adequately
explained by stupidity".
The code in question:
> __asm {
> mov ebx, dwCardID
> add ebx, i
> xor eax,eax
> mov al, bTmp
> mov byte ptr [ebx],al
> }
Seems the equivalent to:
dwCardID[i] = bTmp;
Doing the "xor eax, eax" (i.e. "eax = 0") just before setting and
reading "al" suggest that it was not generated by a compiler, but by
someone trying to "optimize" something.
---
Daniel K. O.
|