How to create .s file in LPCXpresso

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to create .s file in LPCXpresso

3,877件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Mar 09 12:53:40 MST 2011
How do I create a <filename>.s file in LPCXpresso?

In another life I used the  [B]-S[/B] option (ie to generate the assembly equivalent of the code generated).
$gcc -c test.c -S -o test.s
0 件の賞賛
返信
13 返答(返信)

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun Apr 03 17:34:01 MST 2011

Quote: tim@newtek.com
I opened the asm_xample11 project and it works fine. How do I add new .s files to a project?



Hi Tim,

The thread title is a little misleading as I wanted to see the intermediate output of the compiler/assembler on a project I was working on.

I usually don't code in assembly so you may have to wait for someone else to answer your question or delete your message and start a new thread.
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rmteo on Sun Apr 03 17:33:11 MST 2011
This is how I add a file to any project.  Right-click on the appropriate folder and select New/File.
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tim@newtek.com on Sun Apr 03 17:22:20 MST 2011
I opened the asm_xample11 project and it works fine. How do I add new .s files to a project?
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Mar 14 08:57:30 MST 2011

Quote:

    -Wa,-ahlnds=${!OutputFileBaseName}.asm
Should be:
    -Wa,-ahlnds=${OutputFileBaseName}.asm


Oops, introduced this a couple of days ago when I changed the font used for displaying this option - which means the wiki escape character ("!") no longer required.

Now fixed. Thanks for pointing this out.

Regards,
CodeRedSupport.
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Mon Mar 14 08:52:57 MST 2011

Quote: CodeRedSupport
For future reference, there is an FAQ on this at:

http://support.code-red-tech.com/CodeRedWiki/DisassObsjExes

This FAQ also provides an alternative to using [FONT=Courier New][SIZE=1]-save-temps[/SIZE][/FONT] for producing a disassembly of each object file every time that you carry out a build.

Regards,
CodeRedSupport



Hate to nit pick, but there's an extraneous character in the option given on that Wiki page.

    -Wa,-ahlnds=${!OutputFileBaseName}.asm
Should be:
    -Wa,-ahlnds=${OutputFileBaseName}.asm
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Mar 10 00:36:47 MST 2011

Quote: piperazine

Not sure if this is what you want, but right clicking a .o file or .axf file then choosing Binary Utilities > Disassemble  creates a disassembled file (.dis).


For future reference, there is an FAQ on this at:

http://support.code-red-tech.com/CodeRedWiki/DisassObsjExes

This FAQ also provides an alternative to using [FONT=Courier New][SIZE=1]-save-temps[/SIZE][/FONT] for producing a disassembly of each object file every time that you carry out a build.

Regards,
CodeRedSupport
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Mar 09 16:04:05 MST 2011
>>:) happens.

I needed to see the difference in how the compiler allocated and aligned memory as in:

struct test_t {
  int  a;
  char b;
  int  c;
} ;
 
struct test_t test = { 10, 20, 30};

 
 .global test
 .section .data.test,"aw",%progbits
 .align 2
 .type test, %object
 .size test, 12
test:
 .word 10
 .byte 20
 .space 3
 .word 30
 
struct test_t2 {
  int  a;
  char b;
  int  c;
} __attribute__((__packed__));
 
struct test_t2 test2 = { 10, 20, 30};
 
 .global test2
 .section .data.test2,"aw",%progbits
 .type test2, %object
 .size test2, 9
test2:
 .4byte 10
 .byte 20
 .4byte 30


Worked great.
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed Mar 09 14:47:02 MST 2011

Quote: larryvc
I followed the typo got it now.[B] -save-temps[/B]

Thanks



Oops :o
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Mar 09 14:44:17 MST 2011

Quote: jharwood
If you want to see the results of the compiler after pre-processing and compilation, just add:  [B]-same-temps[/B] to your compiler options.

It will then leave the .i and .s files in your build directory.



I followed the typo got it now.[B] -save-temps[/B]

Thanks
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed Mar 09 14:27:01 MST 2011
Here's a screen shot:

[ATTACH]344[/ATTACH]
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Mar 09 14:18:44 MST 2011
piperazine not quite, but I didn't know that and it looks useful.:)

jharwood that's probably what I want but I'm new to Eclipse.  Can you tell me how to accomplish that?:o
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Wed Mar 09 13:42:21 MST 2011
If you want to see the results of the compiler after pre-processing and compilation, just add:  [B]-save-temps[/B] to your compiler options.

It will then leave the .i and .s files in your build directory.
0 件の賞賛
返信

3,687件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by piperazine on Wed Mar 09 13:20:45 MST 2011
Hello,

Not sure if this is what you want, but right clicking a .o file or .axf file then choosing Binary Utilities > Disassemble  creates a disassembled file (.dis).
0 件の賞賛
返信