[comp.lang.pascal] Turbo 80286 code on V30

vereijken@rulcri.leidenuniv.nl (Jan Joris Vereijken) (03/27/91)

Hi :-)
 
Some days ago I asked in this newsgroup why it is that my V30 based XT runs
Turbo Pascal executables compiled with the $G+ (generate 80286 code).
 
			SUMMARY

	- Turbo generated 80286 code runs GREAT on V20 and V30's.
	- Mankind even knows why, on guesswork or mysteries involved.
	- Own a V20/V30 based beast? Set Turbo to generated 80286 code!

In detail: 

Lots of people responded, and gave me LOTS of info (I especially liked the
answer given by a Richard Ward from Microsoft (thanx!)). All is clear now:
 
It turns out that the V20/V30 chip can handle ALL 80186 instructions.
Further more, the 80186 can handle all 80286 instructions, save the protected
mode stuff.
 
The Turbo Pascal help says:
 
  "In the {$G+} state, the compiler uses the additional instructions of the
   80286 to improve code generation.
 
   Programs compiled in this state cannot run on 8088 and 8086 processors.
 
   Additional instructions used in the {$G+} state include ENTER, LEAVE, PUSH
   immediate, extended IMUL, and extended SHL and SHR."
 
This is very fortunate, as the ENTER and LEAVE instructions make possible much
better prologue and epilogue sections in procedures and functions.
 
In short: it works. When you have a V20 of V30 installed, have Turbo generate
80286 code!
 
I'd like to thank all people that helped me out on this one :-)
 
Greetings,
 
- Jan Joris -

vereijken@rulcri.leidenuniv.nl (Jan Joris Vereijken) (03/27/91)

Hi :-)
 
Some days ago I asked in this newsgroup why it is that my V30 based XT runs
Turbo Pascal executables compiled with the $G+ (generate 80286 code).
 
			SUMMARY

	- Turbo generated 80286 code runs GREAT on V20 and V30's.
	- Mankind even knows why, on guesswork or mysteries involved.
	- Own a V20/V30 based beast? Set Turbo to generated 80286 code!

In detail: 

Lots of people responded, and gave me LOTS of info (I especially liked the
answer given by a Richard Ward from Microsoft (thanx!)). All is clear now:
 
It turns out that the V20/V30 chip can handle ALL 80186 instructions.
Furthermore, the 80186 can handle all 80286 instructions, save the protected
mode stuff. The Turbo generated 80286 instructions are real-mode.
 
The Turbo Pascal help says:
 
  "In the {$G+} state, the compiler uses the additional instructions of the
   80286 to improve code generation.
 
   Programs compiled in this state cannot run on 8088 and 8086 processors.
 
   Additional instructions used in the {$G+} state include ENTER, LEAVE, PUSH
   immediate, extended IMUL, and extended SHL and SHR."
 
This is very fortunate, as the ENTER and LEAVE instructions make possible much
better prologue and epilogue sections in procedures and functions.
 
In short: it works. When you have a V20 of V30 installed, have Turbo generate
80286 code!
 
I'd like to thank all people that helped me out on this one :-)
 
Greetings,
 
- Jan Joris -