Skip to main content
Visitor II
January 18, 2024
Question

stm32cube to compile legacy arm syntax?

  • January 18, 2024
  • 1 reply
  • 1020 views

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!

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    January 18, 2024

    >>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    January 18, 2024

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..