对 LSS init_stack,%esp 语句的分析

来源:互联网 发布:微信分销系统 php 编辑:程序博客网 时间:2024/04/28 00:46

转自http://blog.csdn.net/tonutu/article/details/3268321



LSS init_stack,%esp


             .

             .

             .


             .file 128,4,0

init_stack:

             .long init_stack

             .word 0x10


把 init_stack 地址处的内容既init_stack 有效地址给esp,同时把0x10ss段寄存器


参考了下面一段英文(红色字体部分,Intel Assembly 语法):

LDSLESLFSLGSLSS: Load Far Pointer

    LDS reg16,mem                 ; o16 C5 /r            [8086]    LDS reg32,mem                 ; o32 C5 /r            [386]        LES reg16,mem                 ; o16 C4 /r            [8086]    LES reg32,mem                 ; o32 C4 /r            [386]        LFS reg16,mem                 ; o16 0F B4 /r         [386]    LFS reg32,mem                 ; o32 0F B4 /r         [386]        LGS reg16,mem                 ; o16 0F B5 /r         [386]    LGS reg32,mem                 ; o32 0F B5 /r         [386]        LSS reg16,mem                 ; o16 0F B2 /r         [386]    LSS reg32,mem                 ; o32 0F B2 /r         [386]

These instructions load an entire far pointer (16 or 32 bits of offset, plus 16 bits of segment) out of memory in one go. LDS, for example, loads 16 or 32 bits from the given memory address into the given register (depending on the size of the register), then loads the next 16 bits from memory into DSLESLFSLGS and LSSwork in the same way but use the other segment registers.


LSS init_stack,%esp


             .

             .

             .


             .file 128,4,0

init_stack:

             .long init_stack

             .word 0x10


把 init_stack 地址处的内容既init_stack 有效地址给esp,同时把0x10ss段寄存器


参考了下面一段英文(红色字体部分,Intel Assembly 语法):

LDSLESLFSLGSLSS: Load Far Pointer

    LDS reg16,mem                 ; o16 C5 /r            [8086]    LDS reg32,mem                 ; o32 C5 /r            [386]        LES reg16,mem                 ; o16 C4 /r            [8086]    LES reg32,mem                 ; o32 C4 /r            [386]        LFS reg16,mem                 ; o16 0F B4 /r         [386]    LFS reg32,mem                 ; o32 0F B4 /r         [386]        LGS reg16,mem                 ; o16 0F B5 /r         [386]    LGS reg32,mem                 ; o32 0F B5 /r         [386]        LSS reg16,mem                 ; o16 0F B2 /r         [386]    LSS reg32,mem                 ; o32 0F B2 /r         [386]

These instructions load an entire far pointer (16 or 32 bits of offset, plus 16 bits of segment) out of memory in one go. LDS, for example, loads 16 or 32 bits from the given memory address into the given register (depending on the size of the register), then loads the next 16 bits from memory into DSLESLFSLGS and LSSwork in the same way but use the other segment registers.

0 0
原创粉丝点击