[ECOS] Question of ARM and thumb mode switch in vectors.S
Jon Ringle
jringle@vertical.com
Tue Nov 28 03:24:00 GMT 2006
The ## is a preprocessor concatenation that is joining the _l_ with the
letter 'f'. So the line 'ldr _r_,=_l_ ## f' is saying load register _r_
with the value of the label _l_: (the 'f' tells the assembler to look
forward for the label, rather than backward).
Jon
Frank Wu wrote:
> I have a question about the mode switch macro, which I listed below,
> in vectors.S.
> What is ## mean in
> ldr _r_,=_l_ ## f ?
> Is f a constant or _f_? Thanks,
>
> Frank
>
> // Call thumb function from ARM mode, return to ARM
> // mode afterwards
> #define THUMB_CALL(_r_, _l_, _f_) \
> ldr _r_,=_f_+1 ;\
> mov lr,pc ;\
> bx _r_ ;\
> .pool ;\
> .code 16 ;\
> .thumb_func ;\
> ldr _r_,=_l_ ## f ;\
> bx _r_ ;\
> .pool ;\
> .code 32 ;\
> _l_:
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list