Article View: pl.comp.lang.asm
Article #550Re: Neg i carry
From: Johnny
Date: Fri, 25 Aug 2006 06:33
Date: Fri, 25 Aug 2006 06:33
18 lines
1717 bytes
1717 bytes
> nigdzie nie wychodzimy poza zakres. carry nie jest ustawiane. > > neg działa na liczbach ze znakiem. Zakres 8-bitowej liczby ze znakiem to > -128..+127; Zapisywana jest w kodzie uzupełnieniowym do 2. Podany przez > ciebie przykład 80h (czyli 10000000b) w przypadku kodu U2 oznacza liczbę > -128. > > Jeśli chcesz zanegować liczbę -128 w 8-bitowym rejestrze, to liczba > dodatnia +128 WYCHODZI POZA ZAKRES. Ustawiana jest wtedy flaga carry. > Być może się mylę lecz w moim podręczniku napisano, że carry jest ustawiane dla liczb bez znaku, natomiast dla liczb ze znakiem stosuje się overflow. Ponadto przypominam, że operandem jest w moim przykładzie ax czyli 16 bitów. -- Johnny
Technical Details
Message-ID:
<ecm5jo$4v4$1@atlantis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailReferences:
<eck20j$ic8$1@nemesis.news.tpi.pl> <44edc4aa$0$22595$f69f905@mamut2.aster.pl> <1156437936.487681.4190@h48g2000cwc.googlegroups.com> <ecldfh$ghi$1@news.onet.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Johnny <johnny_bez_spamu_@klub.chip.pl> Newsgroups: pl.comp.lang.asm Subject: Re: Neg i carry Date: Fri, 25 Aug 2006 08:33:18 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 18 Message-ID: <ecm5jo$4v4$1@atlantis.news.tpi.pl> References: <eck20j$ic8$1@nemesis.news.tpi.pl> <44edc4aa$0$22595$f69f905@mamut2.aster.pl> <1156437936.487681.4190@h48g2000cwc.googlegroups.com> <ecldfh$ghi$1@news.onet.pl> NNTP-Posting-Host: nat-132.wasko.pl Mime-Version: 1.0 X-Trace: atlantis.news.tpi.pl 1156487608 5092 193.178.240.132 (25 Aug 2006 06:33:28 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Fri, 25 Aug 2006 06:33:28 +0000 (UTC) User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) In-Reply-To: <ecldfh$ghi$1@news.onet.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit