Jose R. Valverde wrote:
Why don't you try to split the assignment into
to reproduce the assembly and the recombine them? Like, e.g.
1: r2 = uap->linkname; /* ldl rr2,rr8(#4) */
2: r4 = (long) r2; /* ldl rr4,rr2 */
3: r4 &= 0x7F00FFFF; /* and rr4,#32512 */
4: u.u_dirp.l = (caddr_t) r4; /* ldl _u+78, rr4 */
hm.. this won't work because the compiler starts handing out registers
the register-declared variables with the highest register possible so
would start with rr10 or so.
u.u_dirp.l = (caddr_t) ((long) (((saddr_t)
uap->linkname).l) & 0x7F00FFFF);
I've changed it to:
u.u_dirp.l = (caddr_t) ((long) (((saddr_t *) uap->linkname)->l) & 0x7F00FFFF);
otherwise it won't compile. It compiles to:
is it because I added a * and changed . to ->?
u.u_dirp = (saddr_t) (((long) uap->linkname) &
"sys2.c":305: operands of CAST have incompatible types
"sys2.c":305: operands of "=" have incompatible types