[Coco] 6809 CC Reg Overflow bit
Gene Heskett
gheskett at shentel.net
Tue Nov 6 18:24:44 EST 2018
On Tuesday 06 November 2018 17:58:22 Brendan Donahe wrote:
> Ok, dumb followup question then - if those 100s and 200s are decimal
> (I see no $) then why is this an overflow? Is overflow for a signed
> byte?
I think so, v is set (I think) if the result is >127, for 2's complement
math. This also explains the need for the SEX, or sign extend
instruction, something the C compiler goes crazy with.
> Brendan
>
> On Tue, Nov 6, 2018 at 4:48 PM William Astle <lost at l-w.ca> wrote:
> > On 2018-11-06 3:14 p.m., Salvador Garcia via Coco wrote:
> > > Hi all. I am reading William Barden's Assembly Language for the
> > > Color
> >
> > Computer and on the bottom of page 57 he presents the following code
> >
> > <snipped>:
> > > LDA #100
> > > ADDA #100 100 + 100 = 200 = V!
> > >
> > > Then on the second paragraph below the code he states:
> > >
> > >
> > > "... The first ADD added an immediate 100 to the 100 in the A
> > > register
> >
> > for a result of 200. This is an overflow condition, and the V
> > Condition Code should have been set to a 0, indicating no overflow:"
> >
> > > If the V Condition Code is set to a 1 to indicate overflow, and
> > > the 100
> >
> > + 100 op caused an overflow, why is he saying that the V Condition
> > code is set to a 0?
> >
> > > Am I missing something? As always, thanks! Salvador
> >
> > The text is in error. V will be set after that instruction sequence.
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
--
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
More information about the Coco
mailing list