Pasting constant into asm code block?

Use stringification like this: #define xstr(s) str(s) #define str(s) #s #define syscall(number) \ ({ \ asm volatile ( \ ". Set noreorder\n" \ "nop\n" \ "syscall "xstr(number)"\n" \ );\ }) For more info on stringification, see this gcc page: gcc.gnu.org/onlinedocs/cpp/Stringificati....

Works great. Thanks ouah! – Mat?

J Zábský Jan 8 at 17:33 @Mat? JZábský you're welcome! – ouah Jan 8 at 17:35.

A bit of a hack, but not THAT much: make a copy of your original syscall macro for each syscall number, naming each for that syscall. Thus, you'd have a macro named SYSCALL_PUTC which would expand into the same as syscall(5) would have.

A possible alternative would be to make your syscall line in your syscall macro contitional based on the number, so that you won't have any assembly lines that reference the parameter directly. Not sure if your compiler will like that any better, though. – Scott Hunter Jan 8 at 17:13.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions