Assembly code fragment explanation
tobias at gambas-buch.de
Sun Sep 23 15:11:39 EDT 2012
On Sun, 23 Sep 2012, K Arun Kumar wrote:
> 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 ??
You will find the answer in your assembler manual and, of course, in your
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.
(a seemingly outdated but sufficient mirror)
More information about the Kernelnewbies