Calling a procedure that exists in another code segment

Discussion in 'General Software' started by jj1984, Jan 6, 2017.

  1. jj1984

    jj1984 Member

    Messages:
    31
    Hello,

    For Intel systems:

    If you call a procedure that exists in the same code segment in which the calling procedure exists, the hardware will push the instruction pointer for the next instruction after the call instruction on the top of the stack using whatever segment you have currently designated as the stack segment.

    But, if you call a procedure that exists in another code segment, will the hardware push the entire far pointer on the stack like it would a near pointer?

    That is, will the hardware automatically push both the segment selector for the calling procedure's segment and the offset within that segment for the next instruction after the call instruction on the top of the stack?

    Thanks.
     
    Last edited: Jan 6, 2017
  2. Cromewell

    Cromewell Administrator Staff Member

    Messages:
    14,856
  3. jj1984

    jj1984 Member

    Messages:
    31
    Yes, well I suppose that the first takes a simple 16-bit address for a segment base and the second takes a pointer to a descriptor in a descriptor table that contains the segment base within it.

    Thanks for your reply.
     

Share This Page