> Wow!
> superb!!!
>
> mov #-1, r14
> rla r15
> adc r14
>
> Thanks!
> cheers,
> ~d

Is it ok to destroy r15?  Because if not, this is going to be a problem...

How about:
    mov #-1, r14
    bit r15, #0x8000
    adc r14
The bit instruction will set the carry just like the rla did, except it will
do so without changing r14.

mvh.

David



>
>
> On Thursday 30 January 2003 12:23, Matthias Weingart wrote:
> > On Thu, Jan 30, 2003 at 11:41:11AM +0300, Dmitry wrote:
> > > 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.
> > >
> > > Can anyone invent a simpler solution?
> >
> > I am not familiar with MSP ASM, but maybe you can
> >
> > mov     #-1, r14
> > move msb of r15 to carry flag
> > add carry to r14
> >
> > no jump needed
> >
> > M.
> >
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by:
> > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> > http://www.vasoftware.com
> > _______________________________________________
> > Mspgcc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
> --
> /********************************************************************
>      ("`-''-/").___..--''"`-._     (\   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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>



Reply via email to