Re: A89: Rotate with carry in TIGCC


[Prev][Next][Index][Thread]

Re: A89: Rotate with carry in TIGCC




The instructions in 68k for rotating is ROR, ROL, ROXR and ROXL.
ROXR and ROXL is what you want. it rotates through the X flag, wich is Xtra 
Carry.
Get yourself a motorola manual and learn 68k-asm!
You already know one asm, and then it is easier to learn another.
You can download them as pdf:s from my homepage http://alh.dhs.org/ti89/
or get them as real books (or pdfs) from somewhere deep inside the motorola 
web.
Read the manual to tigcclib for how to write inline asm in tigcc.

///Olle

At 08:40 2001-01-06, you wrote:
>I am trying to perform the following task:
>In the array of words data[], shift elements the right by one bit, and copy
>the lowest bit of the next element into the highest bit of the current
>element. I use the following code for that:
>
>         WORD data[]; //filled with values later
>         for(i = starting_index; i < ending_index; i++)
>                 data[i] = (data[i] >> 1) | (data[i + 1] << 15);
>
>However, the performance of this piece of code is unsatisfactory. If I were
>writing in C for Intel processor, I would rewrite the code in inline asm
>using RCR instruction (Rotate Carry Right), so I wouldn't have to deal with
>all that shifting and ORing. Unfortunately, I know no M-68K assembly, so the
>question is: Is there a way to do similar thing in TIGCC?
>
>Thank you very much.
>
>Alex Astashyn




Follow-Ups: References: