This macro informs the library to use optimizations for different CPU levels.
By default the library starts out targeting thye 8086 CPU.
The library automatically simulates some of the instructions provided with later processors. For example,pusha
was not introduced until the 186. When targeting an 8086, that instruction will be simulated. So if you want to use the actual pushf
you would use this macro to set the target CPU.
Except for some edge cases, the code savings is usually minimal. Although if your are doing a lot of math using zwords
targeting a 386 or better can make a very big difference in size and performance. But by doing that, your program would no longer support an 8086. Up to you.
If your program contains portions of code for 8086 and optimizations for later processors, you will need to
be careful when using the LAZY_CODE
macro. Any new code that gets included to support the library macros will be generated using the current setting. If you change the setting and issue another LAZY_CODE
, the supporting code will not be regenerated.
As of this writing, there are shortcuts defined for the 7 listed CPU levels. Which are use8086
, use186
, use286
, etc. However, there are no optimizations for anything beyond a 386 at this time and probably never will be.
This macro also defines a series of CPU_ALLOWs based on the set CPU level. For example, using use286
will define CPU_ALLOW_286
, CPU_ALLOW_186
and CPU_ALLOW_8086
.
I recommend just leaving it set for an 8086.