Hi,
As I promissed here comes my first question ;)
While writing several C files for the WEGA/ZEUS kernel out of the
disassembled objects (with unresolved symbols marked as external) I came
across a piece of code I can't get to reproduce when compiling C.
The original object contains:
0006de: 35a2 0004 ldl rr2,rr10(#$0004)
0006e2: 9424 ldl rr4,rr2
0006e4: 0704 7f00 and r4,#$7f00
0006e8: 5d04 8000 0004 ldl $8000+$0x4,rr4
I tried to reproduce it:
ipc.ip_addr.l = *(unsigned long)(uap->addr.l)&0x7F00FFFF;
Which generates:
0008 35a2 0004 59 ldl rr2,rr10(#4)
000c 0702 7f00 60 and r2,#32512
0010 5d02 8000* 61 ldl _ipc+4,rr2
0014 0004*
which looks for me functional the same...
I also tried:
ipc.ip_addr.l = *(unsigned long *)(uap->addr.l)&0x7F00FFFF;
Which generates:
0010 35a2 0004 60 ldl rr2,rr10(#4)
0014 1424 61 ldl rr4, at rr2
0016 0704 7f00 62 and r4,#32512
001a 5d04 8000* 63 ldl _ipc+4,rr4
Which looks "better" but isn't the same as the original because the
adress of rr2 gets loaded into rr4 first, not rr2 itself.
I'm a bit lost because I tried several different */&-pointer stuff to get
this as it is in the original object without success. the elements
ip_addr and addr are both of type saddr_t which is declare as follows:
typedef union
{
caddr_t l;
struct
{
unsigned left;
unsigned right;
} half;
} saddr_t; /* segmented address with parts */
rr4 itself gets later overwritten in both codes - my code and the
original object - it is not reserved for an internal C-variable. Maybe
someone from you can help me here?
--
Oliver Lehmann
http://www.pofo.de/
http://wishlist.ans-netz.de/