.S file in LPCXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.S file in LPCXpresso

573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atieh on Mon Feb 16 10:27:30 MST 2015
Hi

How can I add .s file to C project in LPCXpresso and compile it?

Thanks
Ati
Labels (1)
0 Kudos
8 Replies

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Mar 03 09:25:26 MST 2015
You need to write your function so that it conforms to the procedure call standard (AAPCS, ARM document IHI0042D).

For simple cases it suffices to know that the first four 32 bit arguments end up in R0 to R3, a 32 bit result is in R0.  R4 to R11 need to be preserved. (No guarantees that this is correct or complete, better check for yourself.)
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atieh on Tue Mar 03 09:07:44 MST 2015
Thanks for replies.

Another question:
I have a function :PolyphaseStereo(pcmBuf, sbi->vbuf + sbi->vindex + VBUF_LENGTH * (b & 0x01), polyCoef)
It is written in assembly. How can I link the inputs of this function to the processor's register when I recall it?

Regards
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Feb 17 05:41:21 MST 2015
There's a sample in #10 of

http://www.lpcware.com/content/forum/how-to-compile-assembly-instructions-i-lpcxpresso-ide
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Feb 17 05:30:29 MST 2015
https://sourceware.org/binutils/docs/as/index.html
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atieh on Tue Feb 17 02:51:30 MST 2015
I am new in LPCXpresso. Is there any link for this purpose to get more knowledge? I couldn't find in LPCXpresso help.

Thanks


0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Feb 17 02:13:50 MST 2015
Unfortunately, Keil assembler syntax is not compatible with LPCXpresso (GNU) assembler syntax. The instruction mnemonics are the same, but the assembler directives etc are not. It should not be too difficult to change your assembler file to be compatible.
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atieh on Tue Feb 17 02:03:48 MST 2015
I created .s file and added to project. But after compile, I have error "bad instruction" on all line of this file.
The .s file is attached. If it is possible to have a look at this file would be great. I got  this file from lp4357 mp3 radio project which is for Keil.
LPCXpresso I am working with is 7.5.0.
Thanks
0 Kudos

533 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Feb 16 11:35:20 MST 2015
Just create you file.s (with a .s extension) in the src directory and the assembler will be called to build it, and it will automatically be added to the list of files to be linked.

DO you have a specific problem?
0 Kudos