[Tinyos-devel] TinyOS Application Assembler

Jamie Coates coatesj at dcs.gla.ac.uk
Mon Dec 3 07:25:26 PST 2007


Hello again,

Thank you Razvan for your reply but I fear I have not been entirely clear with what my intentions for the viewing the assembler code. 

I plan on producing the app.s file, modifying it, then continuing on with the compilation process.

The avr-objdump -d approach would get me what I want to see but I don't think it would allow me to then go on and modify it, is this the case?

-Jamie

-----Original Message-----
From: Razvan Musaloiu-E. [mailto:razvanm at cs.jhu.edu]
Sent: Mon 12/3/2007 3:10 PM
To: Jamie Coates
Cc: tinyos-devel at Millennium.Berkeley.EDU
Subject: Re: [Tinyos-devel] TinyOS Application Assembler
 
Hi!

I think it's easier to accomplish what you want by using avr-objdump -d. 
In the beggining you'll see a table with jumps and later in the 
code you'll see the code for them.

$avr-objdump -d main.exe
main.exe:     file format elf32-avr

Disassembly of section .text:

00000000 <__vectors>:
    0:   0c 94 49 00     jmp     0x92
    4:   0c 94 66 00     jmp     0xcc
    8:   0c 94 66 00     jmp     0xcc
    c:   0c 94 66 00     jmp     0xcc
   10:   0c 94 66 00     jmp     0xcc
   14:   0c 94 66 00     jmp     0xcc
   18:   0c 94 66 00     jmp     0xcc
...
00000092 <__init>:
   92:   11 24           eor     r1, r1
   94:   1f be           out     0x3f, r1        ; 63
   96:   cf ef           ldi     r28, 0xFF       ; 255
   98:   d0 e1           ldi     r29, 0x10       ; 16
   9a:   de bf           out     0x3e, r29       ; 62
   9c:   cd bf           out     0x3d, r28       ; 61
...

--
Razvan ME

On Mon, 3 Dec 2007, Jamie Coates wrote:

> Dear all,
>
> First let me apologise if I have made incorrect usage of this mailing 
> list, if I haven't then any answers you can give me to my question will 
> be greatly appreciated, else, would it be possible to be directed to the 
> correct list (if any) :)
> 
> Question:
>
> How do I change the compilation process for a TinyOS application so that 
> I can view the assembler code?
>
> Background:
>
> I want to be able to view the prologue and epilogue code for an 
> interrupt handler. So, after building a Tiny application (say, Blink) I 
> have access to a source file containing the program (app.c).
>
> When I run the avr-gcc over the source file with the -S flag, the 
> compiler will output the assembler for the application minus the 
> required interrupt code. During the process the compiler outputs 
> warnings that it is ignoring the __attribute((signal)), which would 
> explain why I cannot see the assembler code that I am interested in 
> viewing.
>
> The command I use is "avr-gcc -S app.c"
>
> I hope this is enough information to generate responses and any help 
> that you could give me is greatly appreciated,
>
>
> Jamie
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20071203/7f571428/attachment.html


More information about the Tinyos-devel mailing list