🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #5844

Microsoft Fortran 3.3

#5844
From: Jerry Lotto
Date: Tue, 04 Mar 1986 22:39
41 lines
1587 bytes
A reasonably large Fortran program, compiled under Microsoft
Fortran 3.3 gave the following bug:

	parameter size=2048
	real*8 foo, bar, buzz
	dimension foo(size), bar(size), buzz(size)
	common /name/ foo, bar, buzz

do stuff

	variable = (buzz(1) - (4.0d00 * buzz(2))) / 3.0d00

do more stuff

Notice that buzz(1) is 32K (8000H) into name. The resulting code
was in-line 80x87 and read:

	FLD	es:[di][00]
	.
	.
	.
	FMUL	es:[di][8008]

The first line above is the bug... should be es:[di][8000].
The debugger confirms that es:[di] has garbage and es:[di][8000]
has the right number.
Extracting the offending line from the source to a small
subset of the original program creates different code that works
where a dual register addressing mode is used.
Also, changing to:

	common /name/ dummy, foo, bar, buzz

fixes the problem.
-- 

Gerald Lotto - Harvard Chemistry Dept.

 UUCP:  {seismo,harpo,ihnp4,linus,allegra,ut-sally}!harvard!lhasa!lotto
 ARPA:  lotto@harvard.EDU
 CSNET: lotto%harvard@csnet-relay
Technical Details
Message-ID: <574@talcott.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!petrus!scherzo!allegra!princeton!orsvax1!pyrnj!caip!topaz!harvard!talcott!lotto

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!petrus!scherzo!allegra!princeton!orsvax1!pyrnj!caip!topaz!harvard!talcott!lotto
From: lotto@talcott.UUCP (Jerry Lotto)
Newsgroups: net.micro.pc
Subject: Microsoft Fortran 3.3
Message-ID: <574@talcott.UUCP>
Date: Tue, 4-Mar-86 17:39:01 EST
Article-I.D.: talcott.574
Posted: Tue Mar  4 17:39:01 1986
Date-Received: Fri, 7-Mar-86 03:24:13 EST
Organization: Harvard Univ. Chem. Dept.
Lines: 41
Keywords: Bugs Fortran Microsoft