Hi, first I am not experienced at all on this but I was disassembling with bgb and noticed the instruction AND A, which sounds a bit pointless because the docs say it does A = A&A... unless its just for setting the Z flag... whatever.
Anyway, after executing it, the A register was untouched, thats ok, but the F register changed and I can't tell exactly what operation it was supposed to do. Same thing happens with XOR A btw.
//AF = 0140
AND A
//AF = 0120
XOR A
//AF = 0180
(...)
//AF = 0080
AND A
//AF = 00A0
(...)
//AF = 0070
AND A
//AF = 00A0 wtf
Then I googled and found several game boy technical faqs, and all of them say that A7 means AND A, then googled for Z80 opcodes and they also say the same thing and add that its supposed to do A=A&A. So could someone explain how it is supposed to work or if it is a bug on the emulator please?
Also, whats the cnt register, does it get reduced by the time in clocks the instruction was supposed to take?