Article ID: 149696
Article Last Modified on 10/16/2002
void main()
{
enum { FALL=1, WINTER, SPRING, SUMMER };
_asm {
mov eax, WINTER ; <--- This will incorrectly load 'eax'
; with something other than 2.
}
}
void main()
{
#define FALL 1
#define WINTER 2
#define SPRING 3
#define SUMMER 4
_asm {
mov eax, WINTER
}
}
The drawback to the #define directive method is that it has no scope.
Another method that does have scope is this:
void main()
{
const int FALL = 1,
WINTER = 2,
SPRING = 3,
SUMMER = 4;
_asm {
mov eax, WINTER
}
}
Additional query words: InLineAsmIss
Keywords: kbbug kbfix kbvc420fix kbcode KB149696