www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/26/20:34:54

From: ovek AT arcticnet DOT no (Ove Kaaven)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 32 bit registers
Date: Thu, 26 Dec 1996 05:18:17 GMT
Organization: Vplan Programvare AS
Lines: 17
Message-ID: <59t1qo$tv0$1@troll.powertech.no>
References: <59cs4f$58k AT nr1 DOT ottawa DOT istar DOT net> <19961224 DOT 142048 DOT 4751 DOT 1 DOT chambersb AT juno DOT com>
NNTP-Posting-Host: alwayscold.darkness.arcticnet.no
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

chambersb AT juno DOT com (Benjamin D Chambers) wrote:

>Thanx to everyone who suggested methods of swapping words in a dword...
>The catch is, I didn't really need to know :)
>My original question was if there were a way to load a word into the high
>word of a register.

To load the 16-bit value in bx into the high-order word of eax and
preserving everything else, you could try:

roll $16,%eax
movw %bx,%ax
roll $16,%eax

The "rol" swaps the high and low order words...


- Raw text -


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