www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/06/20:36:13

Sender: nate AT cartsys DOT com
Message-ID: <35CA4576.7CE600EB@cartsys.com>
Date: Thu, 06 Aug 1998 17:08:22 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Endlisnis <s257m AT unb DOT ca>
CC: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, Arthur <arfa AT clara DOT net>,
DJGPP Mailing List <djgpp AT delorie DOT com>
Subject: Re: How to make DJGPP treat an int as 16-bit in size.
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980803163922 DOT 3493A-100000 AT is> <35CA13A8 DOT 31E1F541 AT unb DOT ca>

Endlisnis wrote:
> 
> Eli Zaretskii wrote:
> 
> > More accurately, use int where its size doesn't matter and you want the
> > fastest code, and short/long where the size matters.
> 
>      Are you saying that 'int's are faster than 'short's in DJGPP?

They are.  The x86 can execute 32-bit instructions just as fast as
16-bit ones.  However, when in protected mode, the 32-bit form is the
default.  To execute the 16-bit form requires a one-byte prefix (66h,
usually).  This adds a byte to the size of the code, and also requires
an additional cycle to decode.

That is not necessarily true in general, but often is.
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019