From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Assembly code fragment explanation
Date: Sun, 23 Sep 2012 21:11:39 +0200 [thread overview]
Message-ID: <20120923191138.GC6595@aurora> (raw)
In-Reply-To: <1348422604.28620.10.camel@oc2826874472.ibm.com>
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)
prev parent reply other threads:[~2012-09-23 19:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-23 17:50 Assembly code fragment explanation K Arun Kumar
2012-09-23 19:11 ` Tobias Boege [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120923191138.GC6595@aurora \
--to=tobias@gambas-buch.de \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).