Motorola M68000 Betriebsanweisung Seite 110

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 256
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 109
96 Assembly Language Programming for the 68000 Family
What happens if we do use a character code that appears in the string?
When we try to reverse the string, we will terminate the reverse loop
prematurely. This will leave data on the stack that should have been
removed. The consequences of this bad stack depend on the rest of the
program. The very next pop that is performed will result in the wrong
value. Since returns from procedures also use the stack, we can have
disastrous results.
In the next chapter we will discuss subroutines. The stack will be an
extremely important element in the implementation and use of subrou
tines.
Exercises
1. Which register is used as the hardware stack pointer?
2. Do some instructions implicitly reference the stack?
3. Does the 68000 stack grow upward or downward in memory?
4. What addressing mode is used to push data onto the stack?
5. What addressing mode is used to pop data from the stack?
6. Write the instructions necessary to push the value 100 onto the stack.
7. Write the instructions necessary to push the DO register onto the stack
and pop it into the Dl register.
8. Can you access data below the stack pointer?
9. Write the instruction to place the address of variable COUNT onto
the stack.
10. Write the instructions necessary to push the values 1 to 10 onto the
stack.
Answers
1. A7.
2. Yes, the JSR is one example.
3. Downward.
4. Address register indirect with predecrement.
5. Address register indirect with postincrement.
6. h o v e .L #100,-(SP)
7. HOVE L DO r - (SP)
HOVE.L (SP)+,D1
8. Yes, but you cant be sure of what it is.
Seitenansicht 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 255 256

Kommentare zu diesen Handbüchern

Keine Kommentare