Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

assembler macros

2012-01-23 by Steven Hodge

Is there some restriction about using a macro parameter in a label?

The following code will not work.  It gives an "undefined symbol:
usart0_Init" error:

.MACRO _USART_INIT
usart@0_Init:
.... code using @0 parameter ............
.ENDMACRO
.....
call	usart0_Init
.....
_USART_INIT 0
.....

But by simply excluding the entry point label from the macro definition it
does work:

usart0_Init:
.MACRO _USART_INIT
.... code using @0 parameter ............
.ENDMACRO
.....
call	usart0_Init
.....
_USART_INIT 0
.....

It gives the same result in either AVR Studio 4 or 5.

Thanks, Steve

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.