Jacob Rose Posted August 9, 2004 Share Posted August 9, 2004 Hi all, This is my first post. I've been off by myself re-learning assembly and trying to get a little project going*, and I've run in to this problem. Near the top of my code I have this little initialization loop: ldx 60 ; offset starting at the high end lda #%11111111 Sterilize sta $80,x dex bne Sterilize The thing is, $80 plus 60 is BC, nowhere near wrapping around to interfere with the registers, yet somehow it is. It's causing noisy noises and setting all the bits in the player graphics registers. Does anyone have a clue for me? Thank you! * With help from Andrew Davie's and Kirk Israel's tutorials, Andrew Jacobs' 6502 reference, the Stella Programmer's Reference, and looking at source code from all corners - thanks to you all! Quote Link to comment Share on other sites More sharing options...
CPUWIZ Posted August 9, 2004 Share Posted August 9, 2004 If that is cut and pasted, it appears that you are reading from memory address 60 and not loading an immediate value into x (ldx #60). Quote Link to comment Share on other sites More sharing options...
Jacob Rose Posted August 9, 2004 Author Share Posted August 9, 2004 Thank you, CPUWIZ. Your finger has quickly pointed out what should have been obvious, when my head could have been so bruised from skull-on-wall violence. In truth, I was using a handy-dandy constant, but I took it out and put its value in there. Using constants is supposed to make things clearer, but might it have distracted me from seeing what you did? Ah, perhaps I give myself too much credit. Anyway, thank you! That's one more bug squished! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.