Question

In my code below, I am taking a string and creating a copy that changes the lowercase letters to uppercase. For some reason, when I run the code, it only gets through the first word, "This", and then stops.

I thought the 'space' isn't 'null' and should continue branching.

        ORG $5000
data:   dc.b "This is a Test String", 0
        ORG $4000
        ldx #data
        ldy #$5020
loop:   ldaa 1,X+
        anda #$5F
        staa 1,Y+
        bne loop
        bgnd
Était-ce utile?

La solution

Your loop is exited because you are not comparing the space, but the space anded with #$5F, which IS null.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top