Mail Archives: djgpp/1997/03/17/21:06:33
> But, an article on optimization informed me that using a 32-bit compiler
> like DJGPP, if you use shorts and such it adds a whole extra instruction
> for every operation in registers on the value in question, and that to
> speed up code use "int" instead. So I guess portability and optimization
> are sometimes exclusive?
If you are running in 32 bit protected mode, any instructions that operate
on 16 bit operands require an instruction prefix and an extra cycle to
execute. If your running is 16 bit protected mode or real mode (not sure
about the real mode bit, never used it! ;) it has the same problem with
32 bit operands. To make your code faster in 32 bit mode, use 32 bit and
8 bit values, and in 16 bit code you would use 16 bit and 8 bit operands.
Leathal.
- Raw text -