home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!spool.mu.edu!uwm.edu!rpi!psinntp!psinntp!newstand.syr.edu!erc.cat.syr.edu!dmeltzer
- From: dmeltzer@erc.cat.syr.edu (David Meltzer)
- Subject: Re: 386 Assembler Question - Easy one...
- Message-ID: <1992Nov11.230733.4638@newstand.syr.edu>
- Organization: Electronic Resource Center, Syracuse
- References: <1992Nov9.162931.1@camins.camosun.bc.ca> <1992Nov11.114831.6643@ufhx1.ufh.ac.za>
- Date: Wed, 11 Nov 92 23:07:33 EST
- Lines: 23
-
- In article <1992Nov11.114831.6643@ufhx1.ufh.ac.za> cssjs2@ufhx1.ufh.ac.za (Mr I Scheepers) writes:
- >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?
- >
- >How about:
- > mov al,VALUE
- > mov ah,al
- > mov eax,ax
- Wouldnt't that last line move the 16-bit value of AX register to the 32-bit
- EAX register, like doing a mov ax,al? Unfortunately there is no way to
- access the high 16-bits of EAX directly as such, like a EHAX (which would
- invariably lead to a EHAL <sigh>).
- David Meltzer
- ,
-