On Tue, 1 Jun 2004, Eduardo Pereira Habkost wrote: > I am forwarding these messages to you, to check if you have any clue on > why this happened, and why the function worked on older versions. > > I've changed the function to use [bp-2] for the 'ds' variable, and now > the kernel works flawlessly. > > Do you have an explanation on how this function.off stuff works, and if > this have changed on older versions? Oh my, confusion reigns. Okay first the si and di variables are usually defined as callee saves unless you're compiling with the '-Mc' option. The "memcpy_fromfs.off" stuff is generated for optimising the push/pop of the si and di variables. It's a reasonably recent addition so all accesses of si and si can be eliminated if they are unused. However, it's only turned on if you use '-O'. Ie: this is working as it should. You have highlighted a bug though, the definition some of the 'set' variables is actually wrong, they should have memcpy_fromfs.off added when it might be non-zero. BTW: You should really be using those variables to access C arguments and locals, the '_memcpy_fromfs.ds' is for stack pointer relative the '.memcpy_fromfs.ds' is for 'bp' relative. I can fix the bug in one of two ways; either actually add the 'memcpy_fromfs.off' variable to the 'set' variables or simply have the compiler assume that any '#asm' will use si and di. (The asm("...") function will not however.) Actually I think assuming that #asm uses si/di is best because as this example has shown it is quite likely to be true, plus, it's the failsafe option. (PS: It's also very easy to do :-) see attached. ) So do you want me to make it like it was before? :-) -- Rob. (Robert de Bath )