🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6321

Re: 386 Assembler Question - Easy one...

#6321
From: Brad Levy
Date: Tue, 17 Nov 1992 06:01
18 lines
1120 bytes
> In <1992Nov9.162931.1@camins.camosun.bc.ca> morley@camins.camosun.bc.ca writes:
>In 386 assembler I need to fill an extended register with 4 copies
>of the same byte.  Right now I'm using the following:
> 
>   mov  al,VALUE
>   mov  ah,VALUE
>   shl  eax,16
>   mov  al,VALUE
>   mov  ah,VALUE
> 
>I'm curious... is there a better/faster way to stuff the register?

If VALUE is a constant, the fastest would be:

   mov   eax, VALUEVALUEVALUEVALUE
i.e., an immediate 32-bit load.    

- brad
Technical Details
Message-ID: <1992Nov17.060124.11423@informix.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!cs.utexas.edu!sun-barr!olivea!gossip.pyramid.com!pyramid!infmx!neptune!bradl
References: <1992Nov9.162931.1@camins.camosun.bc.ca> <1992Nov11.114831.6643@ufhx1.ufh.ac.za> <1992Nov12.145342.17642@merlin.dev.cdx.mot.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!cs.utexas.edu!sun-barr!olivea!gossip.pyramid.com!pyramid!infmx!neptune!bradl
From: bradl@neptune.informix.com (Brad Levy)
Newsgroups: comp.os.msdos.programmer
Subject: Re: 386 Assembler Question - Easy one...
Message-ID: <1992Nov17.060124.11423@informix.com>
Date: 17 Nov 92 06:01:24 GMT
References: <1992Nov9.162931.1@camins.camosun.bc.ca> <1992Nov11.114831.6643@ufhx1.ufh.ac.za> <1992Nov12.145342.17642@merlin.dev.cdx.mot.com>
Sender: news@informix.com (Usenet News)
Organization: Informix Software, Inc.
Lines: 18