ASM Editor home Projects Docs Learn Blog
Donate
Star on github
M68K Addressing modes Condition codes Shift directions Trap tasks Synth Exceptions Directives Assembler features Complete documentation

abcdaddaddaaddiaddqaddxandandiasdaslasrbccbchgbclrbcsbeqbfchgbfclrbfextsbfextubfffobfinsbfsetbftstbgebgtbhibhsbkptblebloblsbltbmibnebplbrabsetbsrbtstbvcbvscascas2chkchk2clrcmpcmp2cmpacmpicmpmdbccdbcsdbeqdbfdbgedbgtdbhidbhsdbledblodblsdbltdbmidbnedbpldbradbtdbvcdbvsdivsdivsldivudivuleoreoriexgextextbillegaljmpjsrlealinklsdlsllsrmovemoveamovecmovemmovepmoveqmovesmulsmulunbcdnegnegxnopnotororipackpearesetrodrolrorroxdroxlroxrrtdrtertrrtssbcdsccscsseqsfsgesgtshishsslesloslssltsmisnesplststopsubsubasubisubqsubxsvcsvsswaptastraptrapcctrapcstrapeqtrapftrapgetrapgttraphitraphstrapletraplotraplstraplttrapmitrapnetrappltrapttrapvtrapvctrapvststunlkunpk
Create your first project

swap

Swap register halves

Swaps the upper and lower words of a data register.

Size .w

Used in
  • Arithmetic, logic and bitsM68K assembly
  • Multiply and divide, with the remainderM68K assembly
  • A subroutine with its arguments in registersM68K assembly
  • Convert a number to a string in any baseM68K assembly
  • A bouncing ballM68K assembly
  • The snake gameM68K assembly
  • Flappy ASMM68K assembly
XNZVC –●●00
  • ● set from the result
  • 0 always 0
  • – not changed

Forms

  • swap

Operands

Dn
A data register, d0 to d7. More
move.l #$12345678, d0
swap d0 ; d0 = $567812341
2