[stella] Bit instruction

Subject: [stella] Bit instruction
From: Bill Heineman <burger@xxxxxxxxxxxxxxxxx>
Date: Sun, 14 Jul 2002 15:49:14 -0700
Remember, the BIT instruction is one of the most powerful ones in the 6502
instruction set. 

BIT Memory  ;Perform the BIT

Affects 3 flags in this SPECIFIC manner.

Moves Bit #7 from the memory location and places it in the N flag, you can
BPL or BMI solely on the memory location contents.

Moves Bit #6 from the memory location and places it in the V flag, you can
BVC or BVS solely on the memory location contents.

Performs a logical AND with the accumulator and the memory location as a
whole and stores the result of the AND in the Z flags. I.E. You did the AND
instruction and Z is set the same way. However, unlike AND, the accumulator
is NOT affected in anyway. This way, you can do a quick bit test without
damaging the accumulator.

So, with these three effects all in one instruction, it can quickly perform
several operations at once and simply branch to where you should go based on
the operation.

Burger

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


Current Thread