cancel
Showing results for 
Search instead for 
Did you mean: 

stm32cube to compile legacy arm syntax?

kingkong
Associate

Hi folks,

I have an assembly file with 2.5k lines and I'm facing a compiling issue.

It seems that the problem is about the syntax -

GNU compilation support a specific syntax while arm leagacy syntax is different.

 

In example:

name EQU 0xC 

vs

.equ name 0xC

 

Is there any way to make the compiler work with 'legacy' arm code syntax, or it's must be rewritten? :(

Thanks in advance!

2 REPLIES 2

>>Is there any way to make the compiler work with 'legacy' arm code syntax, or it's must be rewritten? :(

You could use the ARMASM (KEIL/MDK) assembler to get an object file, and link at that level.

You might be able to use something like OBJCOPY to disassemble the code into a more GNU/GAS compliant format. I built my disassemblers to generate output that needed very little manual rework into ARMASM

I suppose one could make a script, in the scripting language of your choice, to trans-code the formats. For small amounts of code an editor with search-n-replace or macros might suffice.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

https://forums.raspberrypi.com/viewtopic.php?t=184771

https://github.com/bitbank2/gnu_asm

I believe others have built armasm2gas type tools/scripts. The syntax wars probably been going for 2+ decades

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..