MIPS Code for Memory Allocation and Deallocation

Closed Posted 4 years ago Paid on delivery
Closed Paid on delivery

In this project, you are required to develop a software subsystem for dynamic allocation of memory and implement it in MIPS assembly language. The main program of your code keeps on waiting in a loop for user’s request through console for allocation/deallocation of memory of a size for a variable with a name, and calls allocation or deallocation procedure accordingly. The allocation procedure allocates an available chunk of memory (that is, one not allocated to another variable), and updates an availability list that indicates which portions of memory are allocated and which are free. The new variable is also put in an available row of a table called symbol table along with the information about range of chunks allocated to the variable. When a deallocation request comes from the user, the deallocation procedure is invoked. This procedure updates the availability list by marking the chunks allocated to the variable as free (free for allocation to another variable in a forthcoming allocation request). The symbol table entry corresponding to this variable is also deleted. The allocation and deallocation requests may come in any order, and a possible complication your project needs to handle is the scenario where there may not be enough contiguous memory required for the new variable though the free memory from disjoint chunks may total up to a value higher than the requested amount. For easier design and testing, you may make the following simplifying assumptions:

The pool of memory is very limited, say 2048 bytes

The pool is partitioned into small chunks of equal size (say, 32 bytes each so that in a pool of 2048 bytes, there will be 64 chunks).

Though the memory requests could come for any size, allocation is always done in the integral number of chunks. That is, if a request for 100 bytes is made, 128 bytes (or 4 chunks) are allocated.

Ideas for Design: You need to have a symbol table or a mapping of memory variables and the range of the numbers of chunks allocated. You also need to have a free/availability list, a Boolean array indicated the free and allocated chunks (1 for allocated and 0 for free chunks). Initially, all entries in free list are marked zero (i.e. free). All symbol table entries are also initialized to be available possibly by setting an availability flag to zero.

Assembly x86/x64 Assembler

Project ID: #25150593

About the project

1 proposal Remote project Active 3 years ago

1 freelancer is bidding on average $80 for this job

engamrmohamed94

I am embedded software engineer with good knowledge in assembly programming for MIPS and I made many projects by using assembly

$80 USD in 7 days
(3 Reviews)
1.6