[Top][All Lists]

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

Re: [avr-gcc-list] how to infer lsl instruction...

From: Royce Pereira
Subject: Re: [avr-gcc-list] how to infer lsl instruction...
Date: Wed, 16 Nov 2005 13:46:32 +0530
User-agent: Opera M2/9.0 (Win32)

On Wed, 16 Nov 2005 13:00:03 +0530, varsha <address@hidden> wrote:

Hello all,
i'm using avr-gcc (GCC) 3.4.3 compiler and Atmega 16 as a MCU.

for crc calculation i'm using inline assembly code.
for example..

__asm__ __volatile__
    "lsl r11"    "\n\t"
    "rol r12"    "\n\t"
    "rol r13"    "\n\t"
    "rol r15"

but compiler doesn't generate lsl instruction...
it generates something like this..

    1514: bb 0c        add r11, r11
    1516: cc 1c        adc r12, r12
    1518: dd 1c        adc r13, r13
    151a: ff 1c        adc r15, r15

so what should do to if i want compiler to generate lsl instruction.

If the bytes & execution time is the same, why should make any difference, as long as it acheives the same result. Left shift is the same as multiplying by 2, which is the same as adding a value to itself. Hence the resulting code.


thank you,

***********************Confidentiality Notice***************************

 The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
address@hidden  immediately and destroy all copies of this
message and any attachments.


Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]