| Deutsch English Français Italiano |
|
<102ki8f$cf36$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Stephen Fuld <sfuld@alumni.cmu.edu.invalid> Newsgroups: comp.arch Subject: Re: Why I've Dropped In Date: Sat, 14 Jun 2025 12:23:59 -0700 Organization: A noiseless patient Spider Lines: 60 Message-ID: <102ki8f$cf36$1@dont-email.me> References: <0c857b8347f07f3a0ca61c403d0a8711@www.novabbs.com> <dd6e28b90190e249289add75780b204a@www.novabbs.com> <ec821d1d64555055271e3b72f241d39b@www.novabbs.com> <8addb3f96901904511fc9350c43917ef@www.novabbs.com> <102b5qh$1q55a$2@dont-email.me> <48c03284118d9d68d6ecf3c11b64a76b@www.novabbs.com> <102cd09$23hcu$1@dont-email.me> <42cac84be6fb35b9e468cc174919bc4a@www.novabbs.com> <102eske$2nqdn$1@dont-email.me> <b1157f4e66cf38dd9461927b9262ae6a@www.novabbs.com> <102g6b9$36ikc$1@dont-email.me> <102geum$38g45$1@dont-email.me> <102hfp6$3gg8a$1@dont-email.me> <102hnqs$3hv4m$3@dont-email.me> <dfd73e1785d1de562136a170e6cd5fbe@www.novabbs.com> <102jk11$4rmg$3@dont-email.me> <102k8v4$9ep2$2@dont-email.me> <RIi3Q.1147022$6%s6.1038509@fx12.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 14 Jun 2025 21:24:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="983072af45bdf2e3b0a53f322b6d3480"; logging-data="408678"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1mvpwzAz2tgyQp+YAc2zFO7bC+VtHJHA=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:dQXrJfoWX7dtZNLQDWtV3zyfPYU= Content-Language: en-US In-Reply-To: <RIi3Q.1147022$6%s6.1038509@fx12.iad> On 6/14/2025 10:56 AM, EricP wrote: > Stephen Fuld wrote: >> On 6/14/2025 3:48 AM, Thomas Koenig wrote: >>> quadibloc <quadibloc@gmail.com> schrieb: >>>> On Fri, 13 Jun 2025 17:40:44 +0000, Thomas Koenig wrote: >>>> >>>>> Suppose you're passing an argument from a COMMON block, a common >>>>> occurence back then (pun intended). >>>>> >>>>> SUBROUTINE FOO >>>>> REAL A,B >>>>> COMMON /COM/ A,B >>>>> REAL C >>>>> CALL BAR(B) >>>>> C .... >>>>> END >>>>> >>>>> SUBROUTINE BAR(A) >>>>> REAL A >>>>> A = A + 1 >>>>> END >>>>> >>>>> What should FOO pass to BAR? A straight pointer to B is the >>>>> obvious choce, but there is no base register in sight that the OS >>>>> can know about. >>>> >>>> FOO passes a straight 32-bit pointer to B to BAR, using a load address >>>> instruction to calculate the effective address. >>>> >>>> BAR then uses an instruction which chooses a register with that pointer >>>> placed in it as its base register to get at the value. >>>> >>>> No attempt is made to pass addresses in the short base plus offset form >>>> between routines, because they knew even then that it would never work. >>>> At least not when subroutines are *compiled separately*, which was the >>>> normal practice with System/360 FORTRAN. >>> >>> Correct. >>> >>> Which made nonsense the concept of making data relocatable by >>> always using base registers. >> >> Forgive me, but I don't see why. When the program is linked, the >> COMMON block is at some fixed displacement from the start of the >> program. So the program can "compute" the real address of the data in >> common blocks from the address in its base register. > > If the program was relocated after the call to BAR but before using > the reference to access argument A then it reads the wrong location. That is precisely my point. The mechanism that IBM chose effectively *prevents* program relocation. That is why I believe it was a mistake to choose that mechanism. -- - Stephen Fuld (e-mail address disguised to prevent spam)