Die Präsentation wird geladen. Bitte warten

Die Präsentation wird geladen. Bitte warten

Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 1 Beispiel Stack-Architektur.

Ähnliche Präsentationen


Präsentation zum Thema: "Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 1 Beispiel Stack-Architektur."—  Präsentation transkript:

1 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 1 Beispiel Stack-Architektur

2 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 2 + ÷× 14ab3 14 a × b 3 ÷ + Traversierter Baum (post-order)

3 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 3 14 a × b 3 ÷ + Ausgangslage für Abarbeitung in stack-basierter Architektur Erzeugte Textbeschreibung Keine explizite Adressierung über load, store Instruktionen Sondern Verwenden von push, pop Instruktionen 14 a × b 3 ÷ + push 14 // Konstante 14 auf Stack legen a × b 3 ÷ + a b 14 ToS: Top of stack Zeigt auf ersten freien Platz ToS Push 14 → Stack(ToS) ToS = ToS+1 MemoryStack 12 -3

4 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 4 a × b 3 ÷ + push a // Inhalt im Speicher unter Adresse a auf Stack legen × b 3 ÷ + a b ToS Push Mem(a) → Stack(ToS) ToS = ToS+1 MemoryStack 12 -3 14 12 × b 3 ÷ + x // Multiplizieren b 3 ÷ + a b ToS Stack(ToS-2) x Stack(ToS-1) → Stack(ToS-2) ToS = ToS-1 MemoryStack 12 -3 12 14 12 168

5 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 5 b 3 ÷ + push b // Inhalt im Speicher unter Adresse b auf Stack legen 3 ÷ + a b ToS Push Mem(b) → Stack(ToS) ToS = ToS+1 MemoryStack 12 -3 168 12 3 ÷ + push 3 ÷ + a b ToS Push 3 → Stack(ToS-1) ToS = ToS+1 MemoryStack 12 -3 12 3 -3 168

6 Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 6 ÷ + divide + a b ToS Stack(ToS-2) ÷ Stack(ToS-1) → Stack(ToS-2) ToS = ToS-1 MemoryStack 12 -3 168 12 + add a b ToS MemoryStack 12 -3 12 167 Stack(ToS-2) + Stack(ToS-1) → Stack(ToS-2) ToS = ToS-1


Herunterladen ppt "Lehrstuhl für Informatik 3 - D. Fey Vorlesung GRa - SS 2015 4.5.-18.5.2015, Folie 1 Beispiel Stack-Architektur."

Ähnliche Präsentationen


Google-Anzeigen