Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkHealth: ; Check the health
- lda $9A13 ; Load the value stored in address 9A13 into the accumulator
- cmp #$FF ; Compare the value in the accumulator to 255
- bne incrementHealth ; Branch to incrementHealth if the value is not 255
- rts ; Return to the place where the subroutine was called if the health is 255
- incrementHealth: ; Increment the health
- inc a ; Increment the value in the accumulator by 1
- sta $9A13 ; Store the value in the accumulator into memory address 9A13
- rts ; Return to the place where checkHealth was called
Advertisement
Add Comment
Please, Sign In to add comment