atm959

Earthbound Health Incrementer

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