CrazyEngineers
  • In Assembly Language Programing , if we use a stack then we have to allocate some memory for the stack.Now , my question is if we give the space from 1000h to 2000h in memory then what will be the position of stack pointer. Is it 1000h or 2000h😕
    And when we push an element into the stack there are two possibilities:
    1. first decrement the stack pointer and then pushes the given element on to the stack.
    2.first pushes the element onto the stack and then decrement the stack pointer

    which is correct😕
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • saurabh2486

    MemberAug 19, 2009

    it will be 1000h i suppose and second one is right first push then decrement the pointer
    Are you sure? This action cannot be undone.
    Cancel
  • Raviteja.g

    MemberAug 21, 2009

    see baba
    i refer i came to know that the stack is a pushdown stack,
    and it starts from 2000h and when it is pushed first it decrements and then the element is inserted.

    so , i think this the correct process in the push operation of stack.
    Are you sure? This action cannot be undone.
    Cancel
  • silverscorpion

    MemberAug 24, 2009

    Well, I guess it depends on the device you are using.

    For example, in 8051, the data is first pushed into the stack and then the stack pointer is decremented.

    In 8085, it's vice versa.
    Are you sure? This action cannot be undone.
    Cancel
  • ameyaamu

    MemberAug 24, 2009

    Raviteja.g
    In Assembly Language Programing , if we use a stack then we have to allocate some memory for the stack.Now , my question is if we give the space from 1000h to 2000h in memory then what will be the position of stack pointer. Is it 1000h or 2000h😕
    And when we push an element into the stack there are two possibilities:
    1. first decrement the stack pointer and then pushes the given element on to the stack.
    2.first pushes the element onto the stack and then decrement the stack pointer

    which is correct😕
    hiiii
    when using stack
    stack ptr willbe decremented first thenvalue will be pushed
    rev take place for pop,ie retrieve then increment
    stack willpt to 1000h
    Are you sure? This action cannot be undone.
    Cancel
  • namivrm

    MemberAug 25, 2009

    it may be 1000h n also 2000h... we can use any..it's depanded on us..
    in "push operation first d pointer's position changes aftr that... elt inserting"
    1>> wn pointer starts frm 2000h dn 1st decrement d position of pointer aftr dat insert elt...
    2>> wn it starts frm 1000h 1st incremanet d position n dn insert elt...
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register