I am in process of migrating some legacy code to vxWorks 7.0. The vxWorks 6.9 code has the following few lines of assembly in an ISR. I am seeking an understanding of the below code line-by-line if possible. I am totally inexperienced with PPC assembly and GNU's in-line syntax
__asm__(
"mfdec 3 \n\t" ; I think this may be R3 = DEC timer val
"my_loop:" ; simple label
"add. 3, %0, 3 \n\t" ; ?? Add %0+R3=> R3 with Rc=1. What is %0? The ISR is void isr(void) type.
"ble my_loop \n\t" ; branch if <= to my_loop
"mtdec 3 \n\t" ; move R3 content into DEC
: ; from here down I have no idea
: "r" (val)
: "3","cc"
);
- What is %0?
- What do the ':'s mean after the asm template string?
- What are the other lines (without comments), ie : through "3","cc" doing exactly?