www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/29/13:37:42

Message-ID: <000301bda384$5fe81de0$364e08c3@arthur>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: Re: 64k demo
Date: Mon, 29 Jun 1998 14:00:31 +0100
MIME-Version: 1.0

>SHL is MUCH faster than multiple !


In almost any language, this is correct. It's faster to shift bits along a
byte than it is to multply, carry, check for overflows etc. It's much faster
to divide by using >> or SHR.

I have noticed, though, that the PC only has one type of shifting command.
On the Motorola, there's ASL, ASR (arethmetic), LSL and LSR (logical), along
with the rolling commands ROL and ROR and all the shifting commands that
change different bits depending on the values entered into them. Are there
any of these on the PC?

And while we're on the subject, I am assuming that << and >> are arethmetic
shifting operands. Is there a similar command to do logical shifting in
C/C++?

James Arthur
jaa AT arfa DOT clara DOT net

- Raw text -


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