From: "John M. Aldrich" 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: David Charlton 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 | --------------------------------------------------------------------------