On Tue, Jun 20, 2017 at 6:37 AM, Alan Cox <alan@llwyncelyn.cymru> wrote: > That still doesn't work. The compiler will generate address references to > stack objects itself as will normal things like pointers into an array. > If we ensure the creation of stack frames, that objects will be referenced through register BP, which by default uses the stack segment. Using BCC there will always be stack frames. Using GCC, it would be necessary to use -fno-omit-frame-pointer, to force the use of BP on automatic variables and to prevent using BP as a general purpose index register because, as already said, it will default to use the stack segment. > 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. > In this simple case, the compiler will likely produce: INCW offset_of_var_s[BP] By default, the instruction will use the stack segment without needing any segment override. Juan -- To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html