Question: The linked list will contain a s e n t i n e l node, used t o indicate the end o f the list.

The linked list will contain a sentinel node, used to indicate the end of the list. The elements in the list should be allocated on the heap, with memory allocated using the sbrk syscall available in RARS.
Assignment Details
The assignment consists of implementing 6 procedures (functions) defined inlinkedlist.asm. Each procedure is documented in the comment above the relevant procedure label. You can assume any pre-conditions are fulfilled when the procedure is called. If applicable, your solution must adhere to the post-conditions specified in the documentation.
The first procedure you should implement isLLPUSHFRONT. The tests for every other procedure requires instantiating the linked list, which involves pushing an element to the front of the list. The other procedures can be implemented in any order. You will receive partial credit for each procedure implemented correctly.
Specification
Your solution must follow the following specification:
1. Use 32-bit RISC-V.
2. Each node in the linked list should store a4-byte integer as well as a pointer to the next node.
3. Memory for nodes in the linked list should be allocated on the heap using the sbrk syscall in RARS.
4.An empty linked list consists of one sentinel node, which points to memory location 0x0 and has the value 0.
5. The linked list should not allocate more memory than necessary. If implemented correctly, all nodes should bein a contiguous section of memory on the heap ifLLPUSHFRONT is called successively. If allocations (withsbrk) are made in between calls toLLPUSHFRONT, then the nodes will not bein a contiguous section of memory. Your code must be able to handle nodes that aren't stored contiguously in memory.
6. You can assume memory addresses returned from sbrk are 4-byte aligned.
7. You must save any callee-saved registers before use in the procedures. Failure todoso may result inan incorrect test output. Linked List Example
After the following instructions (note, not assembly):The heap should look like the following diagram:Note that the Head of Linked List represents a register containing the address of the integer 3in the screenshot.
 The linked list will contain a sentinel node, used to indicate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!