Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: ARM_UCOS port and the use of stmfd/ldmfd

2005-09-21 by embeddedjanitor

> ldm/stm are used just about everywhere for stack saving, block 
copying etc.
> 
> There are two forms of stm: stm(1) and stm(2)
> There are three forms of ldm: 1,2,3.
> 
> The stm(1) form seems to be generally safe whereas the stm(2) form 
is only 
> safe in certain cases (saving the SYS/user register bank while not 
in that 
> mode). How you determine which you get, perhaps someone else knows.
..

I just found out:

The difference is achieved by using the "^" and specifying r15 (== pc
). This sets the "S" flag in the instruction encoding.

eg  ldmia r13!,{r0,r1,pc}^

http://www.cl.cam.ac.uk/users/acjf3/papers/bdt.pdf gives some nice 
background

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.