Motorola M68000 Betriebsanweisung Seite 74

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 73
60 Assembly Language Programming for the 68000 Family
have the JMP instruction actually jump to the target label. Here's how
its done.
BCS CLOSE
--------------
< 32K BYTES I
CLOSE: JMP FARWAY
-------------
1
I
I
> 32K BYTES I
PARWAY: .
--------------
We can also do this:
BCS CLOSE
BRA NEXT
CLOSE: JMP PARWAY
NEXT:
This second approach has the advantage that we know the JMP is close
enough, and we have a definite place for it to go without interfering
with other instructions. The BRA instruction is an unconditional branch.
It always branches, but it suffers from the same limited range as the
conditional branches. The solution to this problem can be made even
simpler if the condition for branching is reversed. In other words, if
we could perform a conditional branch when the carry bit was not set,
rather than set, then we could use the conditional branch to go to the next
sequential instruction in the program. We are in luck! The 68000 provides
complementary instructions for all conditional branches. We can always
find an appropriate conditional branch that branches when the condition
we wish to test is not true. In the case of the BCS instruction, the BCC
(branch on carry clear) is the one to use. Our program can now be written:
BCC NEXT
JMP FARWAY
NEXT:
Seitenansicht 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare