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
Posted on 2001-01-07 10:57:00 by mars_matrix
Of course I know that.. mov bx, ax mov ah, bl mov al, bh would do it but I want something prettier ;)
Posted on 2001-01-07 11:08:00 by mars_matrix
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)
Posted on 2001-01-07 11:23:00 by (scalp)
rol ax,8
Posted on 2001-01-07 12:34:00 by Larrry
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.
Posted on 2001-01-07 14:29:00 by Betov
Unless your concerned with clock cycles, make a macro of your not-so-pretty solution and stick it in an include file... NaN
Posted on 2001-01-08 02:11:00 by NaN
Ok, the BSWAP is _not_ supported in 386. Good idea NaN, but I think Ill go with the rol ax :). Thanks.
Posted on 2001-01-08 17:38:00 by mars_matrix
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)
Posted on 2001-01-09 13:25:00 by (scalp)
I believe Win98 requires a 486. Some function called InterlockedIncrement or some similar name uses an instruction introduced in the 486.
Posted on 2001-01-09 14:32:00 by tank