Search code examples
memory-managementheap-memoryx86-16stack-memory8085

Memory allocation from heap or stack?


I read that, In 8085 the starting address of processor is 00000H. Where as, In 8086 the starting address of the processor is FFFF0H.

Now I have also learnt that the top portion of the memory is heap while below lies the stack. What I am confused now is whether in 8085, memory is allocated from stack whereas in 8086 from heap?

Please help me out to clear the concept. Thanks


Solution

  • Heap allocation is a higher-level (C, java, etc) concept than assembly language, you don't have such thing in 808x assembly. You don't "allocate" memory.

    On the other hand, the stack is a native concept of the 808x, as well as countless microprocessors (and virtual machines), it is used each time you use "CALL" for example (the PC is pushed onto the stack). When you RET, the return PC address is popped from the stack. And you can push registers / data onto the stack also.