Mail Archives: djgpp/1996/09/18/13:07:56
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 -