Motorola M68000 Betriebsanweisung Seite 80

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 79
66 Assembly Language Programming for the 68000 Family
Many assemblers will allow the use of the CMP mnemonic for all
variations of the CMP instruction. The assembler figures out what version
to use by looking at the type of the operands in use. However, it is
somewhat sloppy programming to do this. You should always be aware
of what the actual 68000 instructions are. If you issue the following
instruction,
CMP.L VAL1,VAL2
you will lose out, No version of the CMP instruction will allow the use
of two memory operands.
ADDQ and SUBQ Instructions
Many programs require adding or subtracting the constant 1 from a
register or variable. Naturally, the ADD or SUB instruction can be used
to perform this operation.
ADD.L #1,D0
increments the value in the DO register.
SUBI.L #1,VAR55
decrements memory location VAR55. Many microprocessors provide spe
cial instructions to increment or decrement a value. The 68000 instruction
set provides a better way to increment or decrement a number. The
ADDQ (add quick) and SUBQ (subtract quick) instructions are provided.
They can be used to add or subtract a value ranging from 1 to 8. Since
they allow small values other than 1, they are more flexible than their
counterparts on other CPUs. All arithmetic flags are updated just as they
are with the ADDI and SUBI. Here are their general forms:
ADDQ[.<size>] #<data>,<ea>
SUBQ(.<size>] #<data>,<ea>
<size> = B, W, L
<data> is a value between 1 and 8 inclusive
The effective address can be almost any valid addressing mode including
an address register. There is no special form of these instructions when
Seitenansicht 79
1 2 ... 75 76 77 78 79 80 81 82 83 84 85 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare