INSTRUCTION SET
Examples
LDMFD
STMIA
LDMFD
LDMFD
STMFD
These instructions may be used to save state on subroutine entry, and restore it efficiently on return to the calling
routine:
STMED
BL
LDMED
3-46
SP!,{R0,R1,R2}
R0,{R0-R15}
SP!,{R15}
SP!,{R15}^
R13,{R0-R14}^
SP!,{R0–R3,R14}
somewhere
SP!,{R0–R3,R15}
; Unstack 3 registers.
; Save all registers.
; R15 <- (SP), CPSR unchanged.
; R15 <- (SP), CPSR <- SPSR_mode
; (allowed only in privileged modes).
; Save user mode regs on stack
; (allowed only in privileged modes).
; Save R0 to R3 to use as workspace
; and R14 for returning.
; This nested call will overwrite R14
; Restore workspace and return.
S3C2500B