A86: Re: Carry/No Carry


[Prev][Next][Index][Thread]

A86: Re: Carry/No Carry




There is actually not a "no carry" flag.  The NC prefix just means that the
carry flag (1 bit of the flags byte) is not set.  After a logical or
mathematical operation, the carry flag will be set if a carry was performed.
A carry means that the result of an operation overflowed 8 or 16 bits,
depending on what the instruction was:

    ld a,$ff
    add a,$02

The result of FFh+02h should be 101h, but it is truncated to 01h, because it
has to fit in 8 bits.  Thus the carry flag will be set.  The carry flag can
also be thought of as an overflow flag.



-----Original Message-----
From: UnEven Software <uneven14@hotmail.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Friday, October 02, 1998 7:49 PM
Subject: A86: Carry/No Carry


>
>Could someone please explain to me the concept of the carry and no carry
>flags?  Itd be appreciated.
>
>Matt
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com