user379888
user379888

Reputation:

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

Upvotes: 3

Views: 550

Answers (2)

huelbois
huelbois

Reputation: 7012

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.

Upvotes: 2

DarkDust
DarkDust

Reputation: 92335

For a discussion about why the 8085's start address is 0000H (that's four zeros, not five since the processor only supports 16 bit addresses) see this thread.

As to the location of the stack: by modifying SP you can move the stack to wherever you want, but since it grows downward it simply makes sense to move it to the very end of the address space.

Upvotes: 0

Related Questions