avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] How to stop avr-gcc from replacing my code with ellipsis


From: Weddington, Eric
Subject: Re: [avr-chat] How to stop avr-gcc from replacing my code with ellipsis
Date: Mon, 21 May 2012 18:43:56 +0000

Hi Omar,

How are you writing and compiling your code?

Is this C code with inline assembler with nops?

If you just need some inline delays, you can just simply #include 
<avr/builtins.h> and use this function:

extern void __builtin_avr_delay_cycles(unsigned long __n);

The parameter needs to be a constant number specifying the number of cycles 
that you want to delay. It takes care of generating the assembly for you. And, 
AFAIK, it should still show up in your listing. If not, then let me know.

Eric Weddington


> -----Original Message-----
> From: address@hidden [mailto:avr-chat-
> address@hidden On Behalf Of Omar Choudary
> Sent: Monday, May 21, 2012 11:50 AM
> To: address@hidden
> Subject: [avr-chat] How to stop avr-gcc from replacing my code with ellipsis
> 
> Hello,
> 
> I am trying to compile some assembler code that simply has some nops,
> then some sbis and then some nops again.
> 
> However when the code is compiled I get the following in the listing
> file (generated with avr-objdump):
> 
> 00004da6 <test_code_2>:
>     4da6:   2f 93           push    r18
>     4da8:   2f b7           in  r18, 0x3f   ; 63
>     4daa:   f8 94           cli
>     ...
>     4dc0:   86 9a           sbi 0x10, 6 ; 16
>     4dc2:   8e 9a           sbi 0x11, 6 ; 17
>     ...
>     4dd8:   2f bf           out 0x3f, r18   ; 63
>     4dda:   2f 91           pop r18
>     4ddc:   08 95           ret
> 
> As you can see instead of my nops (I should have 10 in the first part
> and then another 10) I got ellipses. Well... I actually want to see my
> nops. How can I do this?
> 
> Thanks,
>  Omar
> 
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avr-chat



reply via email to

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