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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With