🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2780

Re: Int 10H Function 13H - How Do I access BP from C ?

#2780
From: Larry A. Shurr
Date: Wed, 24 Oct 1990 17:24
34 lines
1948 bytes
In article <685@digigw.digital.co.jp>, gday@digigw.digital.co.jp (Gordon Day) writes:
} In article <1990Oct21.204236.22011@nada.kth.se>, d87-vik@dront.nada.kth.se (Ville K{rkk{inen) writes:
} } [Wishes to access BP from C source level in MSoft C.]

} Unfortunately, you can't do this from Microsoft C (at least, not without some
} inline assembler).

} The reason is that the definition 
} of the language doesn't support the idea of "named" registers, that is, a 
} mapping of a special variable name directly to a physical machine register.  
} There is nothing stopping a compiler implementor from doing this (e.g. the 
} VAX based BSD4.3 C compiler), but no compilers (to my knowledge) on the PC do,

You may be interested to know that Turbo C does provide this facility.  Thus,
one can write:

	_AX = 1;

and the AX register gets the value 1.  You must, however, keep your brain 
engaged when using this facility, I once coded the following:

	_AX = foo;
	_BX = this + that;

Afterwords, both AX and BX contained the value of the expression "this + that."
Imagine that!  The compiler used the AX register to calculate the value of
the expression, clobbering what I had put in there beforehand... just like you
would expect.

regards, Larry
-- 
Larry A. Shurr (cbnmva!las@att.ATT.COM or att!cbnmva!las)
The end of the world has been delayed due to a shortage of trumpet players.
(The above reflects my opinions, not those of AGS or AT&T, but you knew that.)
Technical Details
Message-ID: <1990Oct24.172423.22512@cbnews.att.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!bu.edu!att!cbnews!shurr
References: <1990Oct19.202013.28397@nada.kth.se> <685@digigw.digital.co.jp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!bu.edu!att!cbnews!shurr
From: shurr@cbnews.att.com (Larry A. Shurr)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Int 10H Function 13H - How Do I access BP from C ?
Message-ID: <1990Oct24.172423.22512@cbnews.att.com>
Date: 24 Oct 90 17:24:23 GMT
References: <1990Oct19.202013.28397@nada.kth.se> <685@digigw.digital.co.jp>
Organization: AT&T Bell Laboratories, Columbus, OH (actually an AGS consultant)
Lines: 34