delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/18/15:01:58

From: chris doty <orz AT wpi DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: !!NEGATIVE NUMBERS IN ASM!! Pleez answer.
Date: Wed, 18 Feb 1998 14:39:44 -0800
Organization: Worcester Polytechnic Institute
Lines: 8
Message-ID: <34EB6330.2388@wpi.edu>
References: <34EB3694 DOT 714183B6 AT mail DOT htk DOT fi>
NNTP-Posting-Host: orz.res.wpi.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> I just want to know, how I can change a number, which is negative, to
> positive,
> and in asm. I bet it can be done, but how?
>  I've got an almost ready cool demo-effect, but when I add two numbers
> together,
> the other one is negative, and I can't do anything about it.
x86s have hardware support for flipping the sign.  I believe mnemonic is
NEG.  This is equivelent to a NOT followed by an INC.

- Raw text -


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