Page 197 - ARM 64 Bit Assembly Language
P. 197
184 Chapter 6
13 Return 1 for success. Return 0 if stack was empty. */
14 int Pop (IntStack stack);
15
16 /* Return the value that is at the top of the stack. */
17 int Top (IntStack stack);
18
19 /* Print the elements of the stack. */
20 extern PrintStack (IntStack stack);
1 /* File: stack.c */
2
3 #define STACKSIZE 100
4
5 /* The stack is implemented as an array of items and
6 the index of the item at the top */
7 struct IntStackStruct {
8 int stackItems [STACKSIZE];
9 int top;
10 };
11
12 typedef struct IntStackStruct *IntStack;
Write the InitStack function in AArch64 assembly language.
6.6. Referring to the previous question, write the Push function in AArch64 assembly lan-
guage.
6.7. Referring to the previous two questions, write the Pop function in AArch64 assembly
language.
6.8. Referring to the previous three questions, write the Top function in AArch64 assembly
language.
6.9. Referring to the previous three questions, write the PrintStack function in AArch64
assembly language.
6.10. Re-implement all of the previous stack functions using a linked list rather than a static
array.
6.11. The “Software Engineering Code of Ethics And Professional Practice” states that a re-
sponsible software engineer should “Approve software only if they have well-founded
belief that it is safe, meets specifications, passes appropriate tests...” (sub-principle
1.03) and “Ensure adequate testing, debugging, and review of software...on which they
work.” (sub-principle 3.10). Unfortunately, defects did make their way into the system.
The software engineering code of ethics also states that a responsible software engi-
neer should “Treat all forms of software maintenance with the same professionalism as
new development.”