Samsung C8274X User Manual

Page of 324
S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X  
ADDRESS 
SPACES 
 
2-23 
 
Programming TIP — Standard Stack Operations Using PUSH and POP 
The following example shows you how to perform stack operations in the internal register file using PUSH and 
POP instructions: 
 LD 
SPL,#0FFH  ; 
SPL 
 
←  FFH  
 
 
 
;  (Normally, the SPL is set to 0FFH by the initialization  
   
routine) 
 
• 
 • 
 
 
 
PUSH 
PP 
;  Stack address 0FEH  
←  PP 
 
PUSH 
RP0 
;  Stack address 0FDH  
←  RP0 
 
PUSH 
RP1 
;  Stack address 0FCH  
←  RP1 
 
PUSH 
R3 
;  Stack address 0FBH  
←  R3 
 
• 
 • 
 • 
 POP 
R3 
R3 
 
←  Stack address 0FBH 
 POP 
RP1 
RP1 
 
←  Stack address 0FCH 
 POP 
RP0 
RP0 
 
←  Stack address 0FDH 
 POP 
PP 
PP 
 
←  Stack address 0FEH