<<< The XCHG Examples | Index | BSWAP Instruction Swap Bytes >>> |
To exchange two memory operands, use a register as a temporary container and combine MOV with XCHG. For example,
.DATA val1 WORD 1000h val2 WORD 2000h .CODE mov ax, [val1] ; AX = 1000h xchg ax, [val2] ; AX = 2000h, val2 = 1000h mov [val1], ax ; val1 = 2000h
<<< The XCHG Examples | Index | BSWAP Instruction Swap Bytes >>> |