Search code examples
assemblymotorola68000easy68k

How do I move a byte into a specific location in a data register?


I want to move 4 bytes, $B1,B2,B3,B4, one at a time, into data register D1.

The value I want in D1 is $B1B2B3B4.

Which instruction(s) will help me do this?


Solution

  • I found a solution using LSL (Thank you, Chris Stratton), and SWAP:

    MOVE.B      #$B1,D0
    LSL         #8,D0
    MOVE.B      #$B2,D0
    SWAP        D0
    MOVE.B      #$B3,D0
    LSL         #8,D0
    MOVE.B      #$B4,D0