From mboxrd@z Thu Jan 1 00:00:00 1970 From: tobias@gambas-buch.de (Tobias Boege) Date: Sun, 23 Sep 2012 21:11:39 +0200 Subject: Assembly code fragment explanation In-Reply-To: <1348422604.28620.10.camel@oc2826874472.ibm.com> References: <1348422604.28620.10.camel@oc2826874472.ibm.com> Message-ID: <20120923191138.GC6595@aurora> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sun, 23 Sep 2012, K Arun Kumar wrote: > Hi, > > I am trying to understand the x86 boot code where I encountered this > assembly code fragment - > > asm volatile("lcallw *%0" > : : "m" (boot_params.hdr.realmode_swtch) > : "eax", "ebx", "ecx", "edx"); > > > "lcallw *%0" - what does this mean ?? > > Regards, > Arun You will find the answer in your assembler manual[0] and, of course, in your architecture's one. The 'lcallw' instruction is a long-call to the word in here: *%0 which is: take the address stored at memory address operand %0 which is boot_params.hdr.realmode_swtch and jump there. Please, CMIIW. Regards, Tobi [0] http://sources.redhat.com/binutils/docs-2.12/as.info/i386-Syntax.html (a seemingly outdated but sufficient mirror)