Near and Far JMPs

前端 未结 5 1160
梦谈多话
梦谈多话 2021-02-05 23:56

I am doing Linux assembly and I understand that is has a flat memory model. What I am confused about is NEAR and FAR JMPs.

NEAR is in the same segment while FAR is anot

5条回答
  •  滥情空心
    2021-02-06 00:36

    From what I understand there are no segments in linux virtual memory?

    It's accurate enough. There are thread-specific data with a location pointed by %fs segment base, but there is no segments suitable for far jumps.

    Also how do we know if my program's code is laid out in multiple segments?

    If your target platform is Linux, you already know it is not. (I would be surprised if any modern OS still uses segments in a way which makes jump far make sense).

提交回复
热议问题