Posted By
Csabo on 2004-05-14 23:19:22
| Re: XAA!
That is certainly bad news.
Okay, let's look at this in detail. The XAA is supposed to perform a TXA, so loading $00 into A is probably not necessary. (It should behave the same way without that line.) The second thing is: you perform the same operation each time ($FF AND $FF). It would probably be more interesting to see EACH X value ANDed with $FF, and see which bits are kept. Certain bits will come and go, and that's why you have the variation, but why the rest is zero... That's beyond me.
Two more smaller things, just friendly suggestions, I understand that you are new to this. The BEQ/JMP pair can be replaced with a BNE. BEQ will jump on equal, so if it's NOT equal, it will continue to the JMP line. BNE will jump if it's NOT equal, so that's all you would need. Also, what EQUAL really means is the ZERO bit. This bit is set by INY as well. This means you can simply remove the CPY #$FF line. That way, the loop will execute 256 times, and stop why Y overflows and becomes zero again (which is probably what you intended, and not 255 times). But all that's beside the point
Okay, so how about testing this?
LDX #$00 * $8B, $FF STA $1100,X INX BNE * BRK
And while you have your C116 on, there's something else that I always wanted to know. Could you go into Monitor and type >FF7F (return) and see what the first byte is?
|