Question: The following Code is a MIPS for allocating memory. This code is meant to allocate and deallocate memory on user demand. The following restrictions are
The following Code is a MIPS for allocating memory. This code is meant to
allocate and deallocate memory on user demand. The following restrictions
are listed below
The memory pool is limited to bytes
The memory pool divided into equal chunks of bytes chosen due
to MIPS architecture Thus, the bytes memory will be divided
into chunks.
Despite allocation requests coming in any size, the actual allocations
should be performed in integer multiples of chunks. Therefore, the
byte size request will be rounded up to the closest multiple of
To succeed in this task, the code must allocate and deallocate
memory upon request. If some of the requests cannot be handled,
exception handling must be activated to resolve the issue.
When assembling the code in mars I was greeted with two errors. The
errors are highlighted
add $v $t memorypool # Starting address of the current block:
"memorypool": operand is of incorrect type
div $a chunksize # Divide address by chunk size:
"chunksize": operand is of incorrect type
Please Debug the Code. It has been implemented below
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
