* Assembly code fragment explanation
@ 2012-09-23 17:50 K Arun Kumar
2012-09-23 19:11 ` Tobias Boege
0 siblings, 1 reply; 2+ messages in thread
From: K Arun Kumar @ 2012-09-23 17:50 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Assembly code fragment explanation
2012-09-23 17:50 Assembly code fragment explanation K Arun Kumar
@ 2012-09-23 19:11 ` Tobias Boege
0 siblings, 0 replies; 2+ messages in thread
From: Tobias Boege @ 2012-09-23 19:11 UTC (permalink / raw)
To: kernelnewbies
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-23 19:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 17:50 Assembly code fragment explanation K Arun Kumar
2012-09-23 19:11 ` Tobias Boege
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).