Professional Documents
Culture Documents
Expt No: 2 (C) POPING Values From Stack To Registers Date: 19-Jan-2016
Expt No: 2 (C) POPING Values From Stack To Registers Date: 19-Jan-2016
Date: 19-jan-2016
Objectives: Write and assemble a program to
(a) Set SP=0D.
(b) Put a different value in each of RAM locations 0d, 0c,
0b, 0a, 09 and 08.
(c) POP each stack location into register R0-R5.
Program:
Label
Instruction
ORG 0000H
MOV SP,#0DH
MOV 0DH,#10H
MOV 0CH,#11H
MOV 0BH,#12H
MOV 0AH,#13H
MOV 09H,#14H
MOV 08H,#16H
POP 0
POP 1
POP 2
POP 3
POP 4
POP 5
END
Observation:
Before
RESULT:
values into
location
into each
R5 was
compiled.
Stack
set to 0D.
Execution
Address/Reg
R0
R1
R2
R3
R4
R5
R6
R7
SP
SP_max
Data(H)
0X00
0X00
0X00
0X00
0X00
0X00
0X00
0X00
0X00
0X07
After
Execution
Address/Reg
R0
R1
R2
R3
R4
R5
R6
R7
Data(H)
0X10
0X11
0X12
0X13
0X14
0X16
0X00
0X00
SP
SP_max
0X07
0X0d
Program to load
different RAM
and then to pop
of registers R0written and
successfully
pointer was also