TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: CRAIG HART
from: BRIAN MCCLOUD
date: 1997-06-15 11:18:00
subject: ASM optimiser

CH> > That part could be done without too much trouble...  like changing
CH> > multiple SHL
CH> > instructions to a single SHL instruction (286+ can have an immediate
CH> > value for
CH> > a SHL, but an 8086 can't),
CH>SHL ,1 is valid on the 808x. The _difference_ is that 1 is the only
CH>legal immediate value for the 808x processors.
it's not really an immediate value... it's a single byte, followed by an r/m
byte, and the 1 is implied.  For the 80286, there is an immediate byte there
to specify explicitly how far to shift it.
CH> or turning a REP MOVSW into a REP MOVSD (it
CH> > would
CH> > have to find where you assigned CX as well)...
CH>CX does not need to change for any form of the rep instruction. If what 
ou
CH>are trying to say is that rep movsd uses ecx, guess again. it does not.
Your first sentence is incorrect.  To get the same amount of memory for
different REP instructions, you'd need to modify CX, since they're in
different increments of SI and/or DI for each decrement of CX. I know it
doesn't use ECX, but you have to make sure it doesn't move more data than you
wanted.  A REP MOVSW with CX = 8000h would move exactly 64k of data.  A REP
MOVSD with the same CX would try to move 128k of data, which would only work
if you were doing 32-bit addressing, in which case it probably would end up
using ECX as a counter.  To move 64k of data with a REP MOVSD, you'd need to
make CX = 4000h, exactly half as many doublewords as words.  If you were 
sing
REP MOVSB, you'd have to make CX = FFFFh, and add an extra MOVSB at the end.
((Cloud))
MauveCloud@juno.com
 * OLX 2.2 * Jones' Motto: Friends may come and go, but enemies accumu
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.