Microprocessor Simulator 0 Help



Download 1.18 Mb.
Page70/82
Date18.03.2021
Size1.18 Mb.
#56105
1   ...   66   67   68   69   70   71   72   73   ...   82
sms32v50 (3)
sms32v50 (3), sms32v50 (6)

The stack is used to ...


  •  save register contents for later restoration.

  •  pass parameters into procedures and return results.

  •  reverse the order in which data is stored.

  •  save addresses so procedures and interrupts can return to the right place.

  •  perform postfix arithmetic.

  •  make recursion possible.

Stack Pointer


A CPU register (SP) that keeps track of (is a pointer to) the data on the stack. It is colour coded with a blue highlight in the simulator RAM display.

Push and Pop


Push - Add data to the stack at the stack pointer position and subtract one from the stack pointer.
Pop - Add one to the stack pointer and remove data from the stack at the stack pointer position.

LIFO


Last in First out. The stack operates strictly to this rule. When data is pushed onto the stack, it must later be popped in reverse order.

Download 1.18 Mb.

Share with your friends:
1   ...   66   67   68   69   70   71   72   73   ...   82




The database is protected by copyright ©ininet.org 2024
send message

    Main page