From mboxrd@z Thu Jan 1 00:00:00 1970 From: lehmann@ans-netz.de (Oliver Lehmann) Date: Sun, 29 Jun 2008 10:25:23 +0200 Subject: [TUHS] Introduction In-Reply-To: <20080627142430.57e0a9c4@veda.cnb.uam.es> References: <20080604135729.4c50e178@veda.cnb.uam.es> <20080605171758.64c80f06@veda.cnb.uam.es> <20080623161801.19a53c3e@veda.cnb.uam.es> <20080623181101.e862a3a2.lehmann@ans-netz.de> <20080625122505.4e3d9803@veda.cnb.uam.es> <20080626165246.9c3933eb.lehmann@ans-netz.de> <20080627142430.57e0a9c4@veda.cnb.uam.es> Message-ID: <20080629102523.0219a85c.lehmann@ans-netz.de> Jose R. Valverde wrote: > Why don't you try to split the assignment into various statements > 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: ldl rr2,rr8(#4) ldl rr4, at rr2 and r4,#32512 ldl _u+78,rr4 is it because I added a * and changed . to ->? > u.u_dirp = (saddr_t) (((long) uap->linkname) & 0x7F00FFFF); this generates: "sys2.c":305: operands of CAST have incompatible types "sys2.c":305: operands of "=" have incompatible types :( -- Oliver Lehmann http://www.pofo.de/ http://wishlist.ans-netz.de/