Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

proc far and near. What is it mean?

Status
Not open for further replies.

edgarasm

Programmer
Oct 29, 2002
26
BR
somebody could explain what is "proc far" and "proc near" and the diference between them?
 
There are two types of CALLS and JMPS in 16-bit assembly: near and far.

Near contains a 16-bit offset. For calls it will save the IP only.
Far contains a segment and a 16-bit offset. For calls it will save IP and CS.

Defining a proc as FAR tells the assembler that all Calls to that proc must give both a segment and a 16-bit offset. The upshot of this is that the FAR Call will save both IP and CS. There are two variants of RET: RETN and RETF. One will pull off IP and the other will pull of BOTH IP AND CS. Go figure which one, okay?
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top