Closed elnv closed 4 years ago
There are no longer primitive/native instructions for allocation and de-allocation. Instead, we want to leave this to libc.
So, can we access now all memory positions without allocating them previously? Where is the HEAP then? Is there any memory map available with the use of different positions?
When the machine starts, the PC points to the first available memory location, and the SP point to the address after the last available memory location. The code prepended to every program stores the address to the start of the heap in the last 8 bytes before the program itself, see intro3_advanced.s. Hopefully, libc will handle the memory mapping.
Although C compiler does not generate instructions
allocate/deallocate
they should be available to library developers, as it can be necessary to build library functions such asmalloc()
.In version 0.15 they are not apparently supported. Old github examples using these instructions have stopped working.
We think that all native instructions should be visible for the assembly programmer, in addition to syntax sugars.