对 LSS init_stack,%esp 语句的分析

转自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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值