SlideShare a Scribd company logo
1 of 15
REALIZATION OF STACKS
Presented By,
BLESSY DAISE PAUL
ROLL NO:04
MTECH ES
2
3
 Interrupt-Driven I/O
 Evaluating arithmetic expressions
Store intermediate results on stack instead of in registers
 Data type conversion
2’s comp binary to ASCII strings
 Function calls
 Context switches
 Exception handlers
4
 stacks can ascend or descend memory
 stacks can be full or empty
 ARM multiple register transfers support all
forms of the stack
5
Ascending stack: grows up
Descending stack: grows down
A stack pointer (sp) holds the address
of the current top of the stack
Full stack: sp is pointing to the last
valid data item pushed onto the
stack
Empty stack: sp is pointing to the
vacant slot where the next data item
will be placed
6
Stack Processing
ARM support for all four forms of stacks
• Full ascending (FA): grows up; stack pointer points to the
highest address containing a valid data item
• Empty ascending (EA): grows up; stack pointer points to
the first empty location
• Full descending (FD): grows down; stack pointer points to
the lowest address containing a valid data item
• Empty descending (ED): grows down; stack pointer points
to the first empty location below the stack
Two main operations:
PUSH: add an item to the stack
POP: remove an item from the stack
7
Last stacked
Low
Stack
SP
Empty
+8
0
+4
High
Ascending
Empty Ascending
Last stacked
Low
Stack
SP
Full 0
+4
+8
High
Ascending
Full Ascending
Stack Low
Last stacked
High
Descending
-4
-8
-12
0SP
Full posn
Full Descending
Stack Low
Last stacked
High
Descending
0
-4
-8
SP
Empty posn.
Empty Descending
.
A Physical Stack
1995 1996
1998
1982
1995
1998
1982
1995
Initial State After
One Push
After Three
More Pushes
After
One Pop
A Hardware Implementation
• Data items move between registers
/ / / / / /
/ / / / / /
/ / / / / /
/ / / / / /
/ / / / / /
YesEmpty:
TOP #18
/ / / / / /
/ / / / / /
/ / / / / /
/ / / / / /
NoEmpty:
TOP #12
#5
#31
#18
/ / / / / /
NoEmpty:
TOP #31
#18
/ / / / / /
/ / / / / /
/ / / / / /
NoEmpty:
TOP
Initial State After
One Push
After Three
More Pushes
After
Two Pops
10
Stack-oriented suffix For store or push
instructions
For load or pop
instructions
FD (Full Descending
stack)
DB (Decrement
Before)
IA (Increment After)
FA (Full Ascending
stack)
IB (Increment Before) DA (Decrement After)
ED (Empty
Descending stack)
DA (Decrement After) IB (Increment Before)
EA (Empty Ascending
stack)
IA (Increment After) DB (Decrement
Before)
Load and Store Multiples
IA
r1 Increasing
Address
r4
r0
r1
r4
r0
r1
r4
r0 r1
r4
r0
r10
IB DA DB
LDMxx r10, {r0,r1,r4}
STMxx r10, {r0,r1,r4}
Base Register (Rb)
12
Stack type Store Load
Full descending STMFD (STMDB,
Decrement Before)
LDMFD (LDM,
increment after)
Full ascending STMFA (STMIB,
Increment Before)
LDMFA (LDMDA,
Decrement After)
Empty descending STMED (STMDA,
Decrement After)
LDMED (LDMIB,
Increment Before)
Empty ascending STMEA (STM,
increment after)
LDMEA (LDMDB,
Decrement Before)
The Procedure Call Standard for the ARM Architecture (AAPCS),
and armcc always use a full descending stack.
The PUSH and POP instructions assume a full descending stack. They
are the preferred synonyms for STMDB and LDM with writeback.
Stack push & pop operation: stmed
subr1:
stmed r13!, {r0-r2, r14}
(r1)
(r2)
(r14)
when return from SUB1
high
low
r13'
(r0)
r1
r2
r14
on entry to SUB1
low
r13'
r0
highr13
r13
SP moves
down
STMEDr13!, {r0-r2, r14} LDMED r13!, {r0-r2, r14}
13
Old
New
“Empty” means Stack Pointer is
pointing to an empty location
Old
New
Store multiple empty descending instruction
ED (Empty
Descending
stack)
DA (Decrement
After)
IB (Increment
Before)
Stack push & pop operation
14
STMFD r13!, {r4-r7} – Push R4,R5,R6 and R7 onto the stack.
LDMFD r13!, {r4-r7} – Pop R4,R5,R6 and R7 from the stack
FD (Full Descending
stack)
DB (Decrement
Before)
IA
(Increment
After)
12/01/2017
15
THANK YOU……

More Related Content

What's hot (20)

Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
 
program status word
program status wordprogram status word
program status word
 
8086 alp
8086 alp8086 alp
8086 alp
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
Interfacing of io device to 8085
Interfacing of io device to 8085Interfacing of io device to 8085
Interfacing of io device to 8085
 
Evolution Of Microprocessors
Evolution Of MicroprocessorsEvolution Of Microprocessors
Evolution Of Microprocessors
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction description
 
Internal architecture-of-8086
Internal architecture-of-8086Internal architecture-of-8086
Internal architecture-of-8086
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Assembly 8086
Assembly 8086Assembly 8086
Assembly 8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Register Organization of 80386
Register Organization of 80386Register Organization of 80386
Register Organization of 80386
 
Processor Organization
Processor OrganizationProcessor Organization
Processor Organization
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 

Similar to STACK REALIZATION IN ARM

5 chapter3 list_stackqueuepart2
5 chapter3 list_stackqueuepart25 chapter3 list_stackqueuepart2
5 chapter3 list_stackqueuepart2SSE_AndyLi
 
Stack - Data Structure - Notes
Stack - Data Structure - NotesStack - Data Structure - Notes
Stack - Data Structure - NotesOmprakash Chauhan
 
C++ Program It is only 1 rotation. Up-rotation of a stack. Write a.pdf
C++ Program It is only 1 rotation. Up-rotation of a stack.  Write a.pdfC++ Program It is only 1 rotation. Up-rotation of a stack.  Write a.pdf
C++ Program It is only 1 rotation. Up-rotation of a stack. Write a.pdfpallavi953613
 
Microprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingMicroprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingSamiul Ehsan
 
Learning ObjectivesGain some experience using dynamic data structu.docx
Learning ObjectivesGain some experience using dynamic data structu.docxLearning ObjectivesGain some experience using dynamic data structu.docx
Learning ObjectivesGain some experience using dynamic data structu.docxjesseniasaddler
 
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language Usman Bin Saad
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTUREMandeep Singh
 
8086 Microprocessor Instruction set
8086 Microprocessor Instruction set8086 Microprocessor Instruction set
8086 Microprocessor Instruction setVijay Kumar
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsCysinfo Cyber Security Community
 
Applicationofstack by Ali F.RAshid
Applicationofstack  by Ali F.RAshid Applicationofstack  by Ali F.RAshid
Applicationofstack by Ali F.RAshid ali rashid
 
Application of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaApplication of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaDipayan Sarkar
 

Similar to STACK REALIZATION IN ARM (18)

5 chapter3 list_stackqueuepart2
5 chapter3 list_stackqueuepart25 chapter3 list_stackqueuepart2
5 chapter3 list_stackqueuepart2
 
Stack
StackStack
Stack
 
Stack - Data Structure - Notes
Stack - Data Structure - NotesStack - Data Structure - Notes
Stack - Data Structure - Notes
 
C++ Program It is only 1 rotation. Up-rotation of a stack. Write a.pdf
C++ Program It is only 1 rotation. Up-rotation of a stack.  Write a.pdfC++ Program It is only 1 rotation. Up-rotation of a stack.  Write a.pdf
C++ Program It is only 1 rotation. Up-rotation of a stack. Write a.pdf
 
Microprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingMicroprocessor:stack,shifting,looping
Microprocessor:stack,shifting,looping
 
Learning ObjectivesGain some experience using dynamic data structu.docx
Learning ObjectivesGain some experience using dynamic data structu.docxLearning ObjectivesGain some experience using dynamic data structu.docx
Learning ObjectivesGain some experience using dynamic data structu.docx
 
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTURE
 
Stack
StackStack
Stack
 
8086 Microprocessor Instruction set
8086 Microprocessor Instruction set8086 Microprocessor Instruction set
8086 Microprocessor Instruction set
 
8086_inst. set.pdf
8086_inst. set.pdf8086_inst. set.pdf
8086_inst. set.pdf
 
Stack
StackStack
Stack
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basics
 
Stack
StackStack
Stack
 
Parsing
ParsingParsing
Parsing
 
Applicationofstack by Ali F.RAshid
Applicationofstack  by Ali F.RAshid Applicationofstack  by Ali F.RAshid
Applicationofstack by Ali F.RAshid
 
Application of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaApplication of Stack - Yadraj Meena
Application of Stack - Yadraj Meena
 
Lecture 15 16
Lecture 15 16Lecture 15 16
Lecture 15 16
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 

STACK REALIZATION IN ARM

  • 1. REALIZATION OF STACKS Presented By, BLESSY DAISE PAUL ROLL NO:04 MTECH ES
  • 2. 2
  • 3. 3  Interrupt-Driven I/O  Evaluating arithmetic expressions Store intermediate results on stack instead of in registers  Data type conversion 2’s comp binary to ASCII strings  Function calls  Context switches  Exception handlers
  • 4. 4  stacks can ascend or descend memory  stacks can be full or empty  ARM multiple register transfers support all forms of the stack
  • 5. 5 Ascending stack: grows up Descending stack: grows down A stack pointer (sp) holds the address of the current top of the stack Full stack: sp is pointing to the last valid data item pushed onto the stack Empty stack: sp is pointing to the vacant slot where the next data item will be placed
  • 6. 6 Stack Processing ARM support for all four forms of stacks • Full ascending (FA): grows up; stack pointer points to the highest address containing a valid data item • Empty ascending (EA): grows up; stack pointer points to the first empty location • Full descending (FD): grows down; stack pointer points to the lowest address containing a valid data item • Empty descending (ED): grows down; stack pointer points to the first empty location below the stack Two main operations: PUSH: add an item to the stack POP: remove an item from the stack
  • 7. 7 Last stacked Low Stack SP Empty +8 0 +4 High Ascending Empty Ascending Last stacked Low Stack SP Full 0 +4 +8 High Ascending Full Ascending Stack Low Last stacked High Descending -4 -8 -12 0SP Full posn Full Descending Stack Low Last stacked High Descending 0 -4 -8 SP Empty posn. Empty Descending .
  • 8. A Physical Stack 1995 1996 1998 1982 1995 1998 1982 1995 Initial State After One Push After Three More Pushes After One Pop
  • 9. A Hardware Implementation • Data items move between registers / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / YesEmpty: TOP #18 / / / / / / / / / / / / / / / / / / / / / / / / NoEmpty: TOP #12 #5 #31 #18 / / / / / / NoEmpty: TOP #31 #18 / / / / / / / / / / / / / / / / / / NoEmpty: TOP Initial State After One Push After Three More Pushes After Two Pops
  • 10. 10 Stack-oriented suffix For store or push instructions For load or pop instructions FD (Full Descending stack) DB (Decrement Before) IA (Increment After) FA (Full Ascending stack) IB (Increment Before) DA (Decrement After) ED (Empty Descending stack) DA (Decrement After) IB (Increment Before) EA (Empty Ascending stack) IA (Increment After) DB (Decrement Before)
  • 11. Load and Store Multiples IA r1 Increasing Address r4 r0 r1 r4 r0 r1 r4 r0 r1 r4 r0 r10 IB DA DB LDMxx r10, {r0,r1,r4} STMxx r10, {r0,r1,r4} Base Register (Rb)
  • 12. 12 Stack type Store Load Full descending STMFD (STMDB, Decrement Before) LDMFD (LDM, increment after) Full ascending STMFA (STMIB, Increment Before) LDMFA (LDMDA, Decrement After) Empty descending STMED (STMDA, Decrement After) LDMED (LDMIB, Increment Before) Empty ascending STMEA (STM, increment after) LDMEA (LDMDB, Decrement Before) The Procedure Call Standard for the ARM Architecture (AAPCS), and armcc always use a full descending stack. The PUSH and POP instructions assume a full descending stack. They are the preferred synonyms for STMDB and LDM with writeback.
  • 13. Stack push & pop operation: stmed subr1: stmed r13!, {r0-r2, r14} (r1) (r2) (r14) when return from SUB1 high low r13' (r0) r1 r2 r14 on entry to SUB1 low r13' r0 highr13 r13 SP moves down STMEDr13!, {r0-r2, r14} LDMED r13!, {r0-r2, r14} 13 Old New “Empty” means Stack Pointer is pointing to an empty location Old New Store multiple empty descending instruction ED (Empty Descending stack) DA (Decrement After) IB (Increment Before)
  • 14. Stack push & pop operation 14 STMFD r13!, {r4-r7} – Push R4,R5,R6 and R7 onto the stack. LDMFD r13!, {r4-r7} – Pop R4,R5,R6 and R7 from the stack FD (Full Descending stack) DB (Decrement Before) IA (Increment After)