Re: [stella] 6502 question

Subject: Re: [stella] 6502 question
From: jimn8@xxxxxxxxxx (Jim Nitchals)
Date: Fri, 4 Apr 1997 17:50:15 -0800 (PST)
> 
> Yeah, I checked my code and DASM was turning it into an Absolute,Y for me
> without telling me.  

  LDA zeropage,Y isn't supported so it's converted to LDA absolute,Y.
Use LDA zeropage,X for the extra cycle speedup.

> questions: what does ADC do to the overflow flag, and how does BIT affect
> the flags?  (I need a more complete reference..)

ADC will set the overflow flag if the result's most significant bit doesn't
reflect the correct sign of the result.  $7F + $01 = $80 plus overflow.
$7E + $01 = $7F but no overflow.

BIT sets the N flag (BMI/BPL) based on the most significant bit of the
byte tested.  It sets the V (overflow) flag based on bit 6.  It sets the
Z flag based on the logical AND of the accumulator and the byte tested.

Many 2600 read registers use bit 7 (the most significant bit) and bit 6
for input data.  That way a single BIT instruction can test either or
both bits quickly, and without disturbing the accumulator's contents.


--
Archives available at http://www.biglist.com/lists/stella/archives/
E-mail UNSUBSCRIBE in the body to stella-request@xxxxxxxxxxx to be removed.

Current Thread