From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 19 Aug 93 02:18:06 GMT From: portal!cup.portal.com!R_Tim_Coslet@uunet.uu.net Subject: Re: Data Overlays Message-ID: <88340@cup.portal.com> List-Id: > As for creating an overlay by using an address clause, here's the kind >of problem you could get into. Consider the following very simplified >example: > > X : Integer; > Y : Integer: > FOR X USE AT Y'Address; > > X := 1; > ... > IF Y = 1 THEN ... > >It might be that your compiler, using standard code generation techniques, >is using a delayed store on the value of X, which means basically that the >1 is held in a register for a period of time rather than being immediately >placed into the memory location of X. As a result, Y does not have the >expected value when the IF statement is executed. Since the overlaying has Or alternatively, the compiler could store the value of 1 into the overlayed variable... but having previously worked with Y, it still resides in a register and since Y wasn't manipulated when X was loaded with 1, the compiler chooses to use the copy of Y "still in the register" for the test. As a result, Y does not have the expected value when the IF statement is executed. Same unexpected result, but different cause. R. Tim Coslet Usenet: R_Tim_Coslet@cup.portal.com technology, n. domesticated natural phenomena