Semihosting is typically used when debugging an application
that is using the C library and running without an operating system.
This enables functions in the C library, such as
to use the screen and keyboard on the host workstation instead of
having a screen and keyboard on the target system.
Semihosting uses stack base and heap base addresses to determine the location and size of the stack and heap.
The stack base, also known as the top of memory, is an address that is by default 64K from the end of the heap base.
The heap base is by default contiguous to the application code.
The following figure shows a typical layout for an ARM® target.