asm and __asm__ ?
asm and __asm__ ?
I've seen code that uses both ways, and both are accepted by gcc. Is there any reason to choose one spelling over another? Or is it just one of those backwards compatibility things?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:asm and __asm__ ?
__asm__ still exists when -ansi is specified, while asm() isn't ansi
Re:asm and __asm__ ?
I remember reading that [tt]asm[/tt] is the same as [tt]__asm__ __volatile__[/tt]. Something to do what the optimiser is allowed to do; I don't think the optimiser is allowed to move __asm__ __volatile__ blocks around, whereas it is allowed to reorder __asm__ blocks. Don't quote me on that, though.
Re:asm and __asm__ ?
Thanks for your replies. Since __asm__ seems to be more explicit and standard, I guess I'll stick with it.