What register points to the heap?

arm, assembly, c++, heap-memory

Solution

Stack in this context is a lower level structure provided by OS/EABI. That's why there is a conventional register for that. However, heap is a higher level structure provided by OS. So managing and playing with it depends on the agreement with your app and OS. In assembly terms, you'll be using that heap with dereferencing some addresses through registers.

Problem

I just finished learning ARM architecture/assembly. If the SP register holds the address of the next memory location to put data into, what holds the address of the heap? For example in C++ if you declare an object on the heap (e.g. `MyObj example = new MyObj();`) what would the assembly look like, in the sense where would it know where `example` is?

Original source