Mail Archives: djgpp/1998/05/24/12:45:27
Viktor Lundstrom wrote:
>
> I want to either subtract or add 1 to 32-bit register.
> Would this decrease whatever is in %%edi with 1? :
> asm ("movb $-1, %%ah
> addl %%ah, %%edi"
> :
> :
> :"%eax", "%edi");
>
> Or do I have to use a 32bit register (ie. replacing ah with for
> example ebx)?
why not just use increment/decrement instructions? (Or do you want to
add a bigger negative number? )
anyways, the code y-=2; outputs addl $-2,%eax so I guess, yes, you can
use negative numbers.
BTW, group: is there an instruction in ASM for substraction, or just
addition?
- Raw text -