2 Sept 2012

What is a Stack in 8085 ?

In 8085 microprocessor stack is a set of memory location in the read/write memory which specified by the programmer in the main program.Those memory location are used to store binary information temporarily during execution of the program.

When we want to define any stack between any program we have to define starting address of the stack using LXI SP instruction, which is store 16 bit memory address in stack pointer register. After defining stack location in main program,storing of data bytes begin in memory location that is one less than the address in stack pointer register.
 For example
        If we stored memory address 2050H in stack pointer with LXI SP 2050H instruction then storing of data bytes begin at 2049H and continue revers numerical order that means decreasing memory address in Stack. So for good practice we have to define highest available memory for starting stack pointer to overcome conflict with main program address. 

No comments:

Post a Comment