Jump to content
IGNORED

LDA $80,x where x is, oh, around 60 (decimal)


Jacob Rose

Recommended Posts

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...