Assembly code fragment explanation

Tobias Boege tobias at gambas-buch.de
Sun Sep 23 15:11:39 EDT 2012


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)




More information about the Kernelnewbies mailing list