Matt Akkerman

Sorry for the noob question...but I need help!

Discussion created by Matt Akkerman on Sep 18, 2008
Latest reply on Sep 28, 2008 by bigmac
I'm new to this assembly language stuff and I'm very confused at the moment. I'm taking a course and we're learning with the HCS12. Can someone help me with this piece of code please? Here is the assembly source for "mystery":
 
mystery:
        pshb
        ldaa #0
loop:   tstb
        beq mystend
        decb
        pshx
        abx
        pshb
        ldab 0,x
        cmpb #79
        bne notO
        inca
notO:   pulb
        pulx
        jmp loop
mystend:
        pulb
        rts
What does this subroutine do? A step-by-step explanation would be verrrrry helpful. Thanks.

Outcomes