gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Inline ASM: symbol is already defined

#158280 - HyperHacker - Sun Jun 08, 2008 7:48 pm

I upgraded from an older version of libNDS (19 or so), and now my inline ASM no longer works; every label in it causes a "symbol `foo' is already defined" error.
_________________
I'm a PSP hacker now, but I still <3 DS.

#158317 - strager - Mon Jun 09, 2008 3:48 am

Try pre-pending a period (.) before local symbols, e.g.:
Code:

; myFunc
;   Does nothing.
myFunc:
    mov r0, #5
.loop:
    subs r0
    bnz .loop

    bx lr


This helps prevent naming conflicts, and make code a bit more understandable.