Jamie Prescott <jpre...@yahoo.com> writes: > static inline int set_prop(char const *path, char const *name, > void const *data, int size) > { > int error; > > asm volatile ("int\t11\n\t" > : "=a0" (error): "a0" (path), "a1" (name), "a2" (data), > "a3" (size)); > > return error; > } > > extern int calc(int); > > int proc(int i) > { > int j = calc(i); > > return set_prop(0, 0, &j, sizeof(int)); > } ... > > Why is the memory clobber required, and why GCC does not understand to > sync the value to memory when passing the address to a function?
Because you never inform GCC that you will use the value at address *NAME. Try to use "m"(*name) rather than "a1"(name) in the asm. Adam