Motorola M68000 Betriebsanweisung Seite 56

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 55
42 Assembly Language Programming for the 68000 Family
without having to remember different mnemonics for all these instruc
tions.
The general form of the MOVE instruction is
[<label>] MOVE[.<size>] <source>,<destination> [<coroment>]
The <size> following the MOVE indicates the type of operation to be
performed. It must be a B, W, or L, standing for byte, word or longword.
If the size is omitted, the default value is taken as word. The MOVE
instruction takes the value of the source operand and places a copy of
it into the destination operand. The source operand is not changed. The
destination operand may be a data register or a memory location, but
not a constant. The source operand may be a data register, memory
location, or constant. A number of other instructions have source and
destination operands. Always remember that the direction of the data
flow is from the left operand to the right operand. You may have used
an assembly language for another computer (for example, from the 8080
or 8086 families) in which the flow is reversed. Be careful when you start
out programming the 68000 so you don’t make a mistake.
Let’s assume that the DO and D1 registers contain the following values:
D0
D1
123 4SG
We now execute the following instruction:
MOVE.L D0,D1
The DO and D1 registers would contain the following values after execu
tion:
00
D1
123
123
Notice that the previous value in the D1 register has been lost and that
the new value is identical to that contained in the DO register. Also note
that the contents of the DO register remains unchanged. We must also be
careful that the size of the source operand in bytes matches the size of
the destination operand in bytes. This is normally not a problem with the
registers, since they will always accommodate a full longword. However,
specifying a memory location that is actually a byte, when we really
want a word or longword, will result in faulty program behavior. Your
assembler will not be able to catch this mistake, and it is a common cause
Seitenansicht 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare