On top of my head, maybe you don't need a full blown assembler and 6502 emulator for that? I know trying for yourself is of better value, but we can do an experiment halfway at least. Bitwise logic operations is pretty universal. here's an
interactive logic gate simulator you can experiment with.
What an AND 6502 instruction does can semantically be divided into two steps.
-The first is the same as in that simulator, if you set up 8 AND gates (one for each bit) and 2x8 inputs (the two values to be compared).
-The second part is what it outputs as a result and to where. It will output to status flags S and Z, as well as the accumulator it just compared with. Subsequent BEQ and BNE will look for the Z flag.
If any two AND-compared bits are 1, the output is an 1. That also means the resulting output to the accumulator is a non-zero value. thus, the Z flag will be off/0.
BNE will branch on this condition
BEQ will not.
As you might know, "equal" and "zero" are synonyms here. Proof: if a - b = 0, it means a and b must be of equal value. Hence the names of these branch instructions and why they look at zero flag.
Functionally, AND can be used as a mask that only lets one or a few select bits through. You only want to look at a single bit in an 8-bit word and ignore all others? Then you can do it like this:
Code:
LDA #$20 ; 0100 0000
AND #$01 ; 0000 0001
; result is 0000 0000
; which is zero - considered equal!
LDA #$47 ; 0100 0111
AND #$01 ; 0000 0001
; result is 0000 0001
; which is non-zero - considered not equal!
So in the former example, BNE will not branch, but BEQ will.
In the latter example, BNE will branch, but BEQ won't.
Side notes:
The difference between AND and CMP is that CMP won't save the result in the accumulator - it only compares
as if it was carrying out a mathematical or logical operation, whereas AND actually does it. On the other hand, CMP also affects the carry flag. So you can also use BCC and BCS subsequently on CMP, which wouldn't work with AND. Bonus point: AND can reversely be used if you have something stored in carry you don't want to overwrite, to be used later on.
--
Sorry if this wasn't what you were looking for. Just going for the few resources i know which might help.
OR:For whenever i can't note down a value in binary, i use win10's improved calc.exe in toggle switch input mode to quickly check binaries and their hexadecimal counterparts.
That way you can quickly do your experiments in easy6502 even without binary notation support.