分享

jmp fword

 迎风初开 2014-01-19

When you jump to an FWORD PTR, what you're doing is a "far jump" -- that is, the address memory being pointed at consists of contains a 16-bit "selector" (which refers to a segment entry in either the GDT or LDT), and a 32-bit offset from the beginning of the segment the selector refers to. The segment descriptor contains data about the segment, of course...including where in memory it starts.

During the jump, the CPU does some privilege checks to make sure the selector is valid and permitted (there's privilege levels and segment types and such involved), then it effectively loads the first 16 bits into CS, and the rest into EIP. From then on, code addresses effectively get the CS segment's base address added to them to turn them into virtual addresses.



3 added 33 characters in body
source|link

When you jump to an FWORD PTR, what you're doing is a "far jump" -- that is, the address being pointed at consists of a 16-bit "selector" (which is loaded into CS during the jump, and refers to a segment entry in a descriptor table either the GDT or LDT), and a 32-bit offset from the beginning of the segment the selector refers to. The segment descriptor contains data about the segment, of course...including where in memory it starts.

During the jump, the CPU does some privilege checks to make sure the selector is valid and permitted (there's privilege levels and segment types and such involved), then it effectively loads the first 16 bits into CS, and the rest into EIP. From then on, code addresses effectively get the CS segment's base address added to them to turn them into virtual addresses.


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多