I was trying to use the BSWAP in my program like this: ax = 16 bit lo-hi value that I want to convert to hi-lo shl eax, 16 bswap eax Then the compiler says, 'instruction or register not accepted in current CPU mode'. Is the instruction not supported anymore (my reference book is quite old)? Anyone know a better way to do the lo-hi -> hi-lo convertion maybe? regards mars_matrix
Of course I know that.. mov bx, ax mov ah, bl mov al, bh would do it but I want something prettier ;)
If i remember bswap is not supported on 386, so i suppose that you define .386 at the begining of your code, if so, try .486 or .586 hope this help (s)
It should work. It does with Spasm Assembler: mov eax 012345678 shl eax 16 bswap eax hexprint eax ; >>> 07856 So, like Scalp said, review your definitions. betov.
Unless your concerned with clock cycles, make a macro of your not-so-pretty solution and stick it in an include file... NaN
Ok, the BSWAP is _not_ supported in 386. Good idea NaN, but I think Ill go with the rol ax :). Thanks.
due to the number of 386 that are still running out there with Win9x, i think that you can define .486, so you can use bswap (s)
I believe Win98 requires a 486. Some function called InterlockedIncrement or some similar name uses an instruction introduced in the 486.