ARM VERSION 1.2 manual POP reglist, pc, These instructions do not affect the flags

Models: VERSION 1.2

1 360
Download 360 pages 38.37 Kb
Page 206
Image 206

Thumb Instruction Reference

POP {reglist, pc}

This instruction causes a branch to the address popped off the stack into the pc. This is usually a return from a subroutine, where the lr was pushed onto the stack at the start of the subroutine.

In ARM architecture version 5T and above:

if bits[1:0] of the value loaded to the pc are b00, the processor changes to ARM state

bits[1:0] must not have the value b10.

In ARM architecture version 4T and earlier, bits[1:0] of the value loaded to the pc are ignored, so POP cannot be used to change state.

Condition flags

These instructions do not affect the flags.

Architectures

These instructions are available in all T variants of the ARM architecture.

Examples

PUSH

{r0,r3,r5}

 

 

 

PUSH

{r1,r4-r7}

;

pushes r1, r4,

r5, r6, and r7

PUSH

{r0,LR}

 

 

 

POP

{r2,r5}

 

 

 

POP

{r0-r7,pc}

;

pop and return

from subroutine

Incorrect examples

PUSH

{r3,r5-r8}

; high

registers

not allowed

PUSH

{}

; must

be at

least one register in list

PUSH

{r1-r4,pc}

;

cannot

push the pc

POP

{r1-r4,LR}

;

cannot

pop

the

LR

5-12

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

Page 206
Image 206
ARM VERSION 1.2 manual POP reglist, pc, These instructions do not affect the flags