c - Pseudo registers in MSVC -
borland c has pseudo-registers _ax,_bx, _flags etc used in 'c' code save registers temp variables.
is there msvc equivalent? tried @ax, @bx, etc, compiler (msvc1.5) gave error ('40' unrecognized symbol).
i'm developing 16-bit pre-boot app , can't use . thanks.
you don't need have pseudo registers if move values between registers , variables. example:
int = 4; int b = 999; __asm { mov eax, a; // eax equals 4 mov b, eax; // b equals eax } // b equals 4 edit: copy flags variable , flags again, can use lahf , sahf instructions. example:
int flags = 0; __asm { lahf; mov flags, eax; } flags |= (1 << 3); __asm { mov eax, flags; sahf; // 4th bit of flag set }
Comments
Post a Comment