9548086042 for call girls in Indira Nagar with room service
Â
Stack in 8085 microprocessor
1. D R . R . H E P ZI P R A M I L A D E VA M A N I ,
A S S I S TA N T P R O F E S S O R O F P H Y S I C S ,
V. V. VA N N I A P E RU M A L C O L L E G E F O R W O M E N ,
V I R U D H U N A G A R .
STACK IN 8085 MICROPROCESSOR
2. STACK
ï‚— The stack is a group of memory locations in the RAM
(R/W) memory that is used for temporary storage of
binary information during the execution of the
program.
ï‚— The last memory location of the occupied portion of
the stack is called stacktop.
ï‚— The starting memory location of the stack is defined
in the main program by using LXI or SPHL
instruction.
3. STACK
ï‚— Data are stored in the
stack on last-in-first-out
(LIFO) principle and
data are retrieved from
the stack first-in-last-out
principle.
ï‚— Figure shows typical
stack and stack top
location.
4. INSTRUCTIONS
ï‚— PUSH instruction is used to store data in stack
ï‚— POP instruction is to retrieve the contents
ï‚— A register pair is always specified along with these
PUSH and POP instructions.
PUSH B POP B
PUSH D POP D
PUSH H POP H
PUSH PSW POP PSW
B,D,H PSW specifies register pairs BC, DE, HL, A and
Flags
5. PUSH INSTRUCTION
ï‚— PUSH Rp
ï‚— PUSH instruction can be explained with an example
LXI SP,2605H
LXI B, 2550H
PUSH B
Delay Counter
POP B
6. PUSH Instruction
ï‚— Step 1: LXI SP, 2605 will initialize SP register 2605
ï‚— Step 2: LXI B, 2550H will initialize or load BC register
pair with 2550H data so B = 25 and C = 50.
ï‚— Step 3: The execution of PUSH b instruction will be
ï‚— The stack pointer is decreased by one to 2604H and the
contents of the B register are copied to memory location
2604H.
ï‚— The stack pointer is again decreased by one to 2603H and
the contents of the C register are copied to memory
location 2603H.
ï‚— The contents of the register pair BC are not destroyed.
However , BC is made available for the delay counter.
ï‚— The execution of PUSH operation is shown in Figure.
8. POP INSTRUCTION
ï‚— After the delay count, the instruction POP B restores the
original contents of the register pair BC.
ï‚— The execution of POP B instruction will be
ï‚— The contents of the top of the stack location shown by the
stack pointer are copied in the C register and the stack pointer
is increased by one to 2604H
[C]  [SP], [SP]  [SP] + 1
ï‚— The contents of the top of the stack are copied in the B
register and the stack pointer is increased by one
[B]  [SP], [SP]  [SP] + 1
ï‚— The contents of the memory locations 2603H and2604H are
not destroyed until some other data bytes are stored in these
locations.
ï‚— The execution of POP operation is shown in Figure.