Hello Dmitry,

The msp430 is new for me but maybe this is a idea.
mov r15, r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14
rra r14

Okay, i know, this is not the solution.....

Robert

Dmitry wrote:

> Ok, the problem is:
>
> assume that some value is in r15.
> I need to extract a sign bit of r15 and extend it to whole word and save thes
> in r14.
> For example:
>
> r15             r14
> 0x8f01  0xffff
> 0x7341  0x0000
>
> The first solution is simple:
>
>         mov     #-1, r14
>         tst     r15
>         jl      .lab
>         mov     #0, r14
> .lab:
>
> Another one is:
>         mov r15, r14
>         swpb    r14
>         sxt     r14
>         swpb    r14
>         sxt     r14
>
> Can anyone invent a simpler solution?
>
> Cheers,
> ~d
>
> --
> /********************************************************************
>      ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
>       `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys
>       (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
>     _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
>    (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
>  ********************************************************************/
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld http://www.vasoftware.com
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to