www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/18/13:07:56

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Quick inline asm question...
Date: Tue, 17 Sep 1996 19:43:25 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 25
Message-ID: <323F61CD.797B@cs.com>
References: <51mrb2$o5f AT news DOT cais DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp211.cs.com
Mime-Version: 1.0
To: David Charlton <charlton AT the-hermes DOT net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Charlton wrote:
> 
>         Okay, I have a quick question, if it's really easy or stupid
> please don't flame me... anyway, suppose I wanted to add one of the
> 16-bit registers to a 32-bit register (this is for a basic graphics
> routine) -- how would I do that? I've tried "addw %%ax, %%eax", and "addl
> %%ax, %%eax", but it doesn't work. I have a feeling it should be simple,
> but if it's simple it isn't obvious (to me) ;)... so what do I do?

Well, in as much as I understand 16 vs 32-bit assembly, the 'e*x'
registers
are simply 32-bit extended versions of the '*x' registers.  So, %%ax is
in
actuality the lower 16 bits of %%eax.  What you are trying to do is add
the register to itself, which I doubt will work.

-- 
--------------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I    |         fighteer AT cs DOT com          
|
| Proud owner of what might one day  |    http://www.cs.com/fighteer    
|
| be a spectacular MUD...            |  Plan: To make Bill Gates suffer 
|
--------------------------------------------------------------------------

- Raw text -


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