Macros are used to create patterns for code that you often use, and not to enter a constant number. Thus, I do not believe that assembler performs macro decomposition inside an expression. Since you just want a number, you can use .set to define a constant.
.set S, 40 mov %eax, S
Also, if you usually use intel syntax, make sure you understand what this code does: it currently stores the eax value in memory at 0x28. If you want to put the number 40 in eax, you need to cancel the operands and use the dollar sign in front of S.
mov $S, %eax
ughoavgfhw
source share