KanedaFr wrote:ho! i didn't know you have to "backup" cc too.
It's the flag register, right ? CCR ?
thanks for the info
Yes, "cc" is the ccr. It's not really backed up, that's the clobber line which tells the compiler that the clobbered register can't be relied on after the inline assembly. In this case, it tells the compiler that if it HAD been counting on the ccr being a particular state, that state is gone after the assembly.
Any register the compiler uses to pass the args is automatically considered clobbered, so you have to tell it if any other registers get clobbered. Most platforms assume the cc is clobbered by default, but the 680x0 can do so much without clobbering the ccr that it doesn't assume it's clobbered unless you tell it.
Also, "d" and "=d" puts the arg into a data register, while "a" and "=a" puts it in an address register. Shoulda pointed this little bit out in the first post since it's not entirely obvious.