The compiled expects this syntax to prevent duplicate definitions of macro's
.ifndef TRACE_MACROS_S_INCLUDED
TRACE_MACROS_S_INCLUDED = 1
...
.endif
Example
.ifndef TRACE_MACROS_S_INCLUDED
TRACE_MACROS_S_INCLUDED = 1
.include "./src/include/global_constants.s"
.align 2
.section .rodata
STRINGS_TRACE_START_MSG: .asciz "[TRACE] "
.section .text
.align 2
# ===============================================================
# TRACE message_ptr
# ===============================================================
.if TRACE_LEVEL > 0
.macro TRACE message_ptr
la a0, \message_ptr
jal puts
la a0, CRLF
jal puts
.endm
.else
.macro TRACE message_ptr
# No operation when TRACE is disabled
.endm
.endif
.endif
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.