Re: [stella] Euchre back with odd behavior

Subject: Re: [stella] Euchre back with odd behavior
From: Chris Wilkson <ecwilkso@xxxxxxx>
Date: Sat, 16 Jun 2001 17:35:50 -0400 (EDT)
On Fri, 15 Jun 2001, Erik J. Eid wrote:

> I'm now coming up against another problem that I can't get past.  Some code
> is behaving in a peculiar way.

> I used the debugger in PCAE and found something astonishing!  Whatever is
> in the accumulator after the "lda Dealer" statement is increased by two,
> not one, by "adc #$01".  To see this yourself, open up the debugger, find

> Am I just misunderstanding how an immediate-mode adc is supposed to work,
> or is there something very wrong here?  (It is interesting to note that the
> value of memory location 01 - VBLANK - is 2 when this code is executed.)

Erik,

What is the value of the carry bit?  The ADC instruction adds the value of
the carry bit as well as the value that you expect.  You should always be
aware of the state of the carry bit before doing adds or subtracts.

-Chris


-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread