From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Cox Subject: Re: New GCC compiler for 8086 cpu's Date: Tue, 20 Jun 2017 12:37:44 +0100 Message-ID: <20170620123711.2f7d79d3@alans-desktop> References: <20170619144300.2b171cbf@alans-desktop> <20170619215459.3d7382b1@alans-desktop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-8086-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Juan Perez-Sanchez Cc: linux-8086 > Of course, this is the kind of problems I expect to happen. To prevent > this case, one rule of the simple set of rules would be "Use automatic > variables only within the function where it is defined". That still doesn't work. The compiler will generate address references to stack objects itself as will normal things like pointers into an array. Faced with s = s + 1 for an auto variable the compiler is likely to generate something like a word increment of &s, but it's not going to magically put segments in. The DOS folks spent a long time writing very good compilers - they never figured out a hack for this; although in many other languages SS != DS isn't a problem. Alan