We are using a raspberry pi in my computer systems class. We need to Write a statically allocated linked list in ARM assembly.
Steps You Should Follow
Step 1
You will statically allocate some space for your link list elements. You need to make 5 elements, each elements should have two components, the next pointer first then the value stored. First inialize next pointer to NULL. The value stored at the address will be a string pointer. It doesn't matter which values you use
Step 2
You will then write a function that links the statically alloacted linked list elements together.
Step 3
In your main you call your linking function to link all 5 elements together.
Step 4
Print out each emement in order by traversing the list. This means that you can't store each address in registers. You will lose points if you just print everything.
Extra credit
Use the malloc call to allacte for n (any number of entries represented by the letter n) entries from the command line.
Note:
I've added comments for your understanding, and I've used malloc()
in the program.
Get Answers For Free
Most questions answered within 1 hours.