Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!jarthur!rspangle From: rspangle@jarthur.Claremont.EDU (Froot Loop) Newsgroups: comp.windows.ms.programmer Subject: Re: MS-C 286-code in Windows' real mode Message-ID: <10289@jarthur.Claremont.EDU> Date: 9 Jan 91 20:28:39 GMT References: <915@tuura.UUCP> Distribution: comp Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 26 In article <915@tuura.UUCP> risto@tuura.UUCP (Risto Lankinen) writes: >The question is, how can I use the -G2 switch, but still be able to mark >a portion of the program such, that it would be compiled to 8086/88 ? I can think of a few possibilities. 1) Have the FIRST thing your 80286-compiled program does call a routine in a separate module, which is compiled for 8086/88. That routine does all the checking for 8086/88, and returns false if an 8086/88 is present. The main routine exits in that case. You are probably ok doing this, as long as you don't pass any parameters to that routine. (since those would be pushed onto the stack) 2) Compile your main routine for 8086/88. But strip out all the code but the check for 8086, and put this code in functions that are in a module compiled for 80286. Admittedly, these are pretty kludgy. I'm not sure if there's a way to compile for two different chips in one module. -- -------------------------------------------------------------------------- | Randy Spangler | Get your mind out of the gutter | | rspangle@jarthur.claremont.edu | you're blocking my periscope | --------------------------------------------------------------------------