This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Asm bit banding macro

Good day.
I try to create asm bit bannding macro.
it's only macro and invocation code:

MACRO ;macro definition
sram_bit_band_set $p1,$p2
LDR R4,=0x22000000+p1*32+4*p2
MOV R5,#1
STR R5,[R4]
MEND

sram_bit_band_set 0x300,3 ;macro invocation

the compiler generates an error and refers to invocation:

bb.s(26): error: A1821E: Expected constant or register expression

Even simply example doesn't work:

MACRO ;macro definition
test $p1
MOV R0,#p1 ;or LDR R0,=p1 - no difference
MEND

test 5 ;or test #5, or test =5 - nothing

the same error

How can i put const as an argument?

Thanks!