BSWAP swaps the order of the four bytes of a 32-bit register:
bits 0-7 exchange places with bits 24-31, and bits 8-15 swap with
bits 16-23. There is no explicit 16-bit equivalent: to byte-swap
AX, BX, CX or DX, XCHG can be used. When BSWAP
is used with a 16-bit register, the result is undefined.
bswap
8086 and laterByte Swap
bswap reg32 | bswap reg64 | bswap ax | bswap cx | bswap dx | bswap bxLoading...
Forms
Every form of bswap the assembler accepts, from NASM's own instruction table.
The second column is the processor that introduced the form; a badge marks a form that needs
an extension, that is lockable, or that long mode dropped.
| Form | Since | Notes |
|---|---|---|
| bswap reg32 | 486 | |
| bswap reg64 | x86-64 | long |
| bswap ax | 8086 | |
| bswap cx | 8086 | |
| bswap dx | 8086 | |
| bswap bx | 8086 |