admin管理员组文章数量:1302384
I am looking over a segment of code for starting a boot loader to load Linux.
static inline u16 ds(void)
{
u16 seg;
asm("movw %%ds,%0" : "=rm" (seg));
return seg;
}
I believe that this is a way to write assembly inline into the c program. How does this translate to pure assembly? Is this formatting universal for x86/ARM architecture? Is this another abstraction of real assembly to an architecture independent expression?
From what I understand, this instruction moves the word in the regester zero (0) to some place.
Either 1. The ds
register.
or 2. Into the address stored in the ds
register.
Or does it do something else entirely? What is the meaning of two %
before ds
?
本文标签: linuxBoottime assembly code architecture specificStack Overflow
版权声明:本文标题:linux - Boot-time assembly code architecture specific? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741697625a2393098.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论