.UpdateHighScore LDA scoreHi \ If scoreHi < highScoreHi then we have not achieved a CMP highScoreHi \ high score, so jump to high3 to return from the BCC high3 \ subroutine BNE high1 \ If the high byte of the score and high score are not \ equal, then we know scoreHi > highScoreHi, so jump to \ high1 to update the high score LDA scoreLo \ If we get here then scoreHi = highScoreHi, so now we CMP highScoreLo \ check the low bytes. If ScoreLo < highScoreLo then we BCC high3 \ have not achieved a high score, so jump to high3 to \ return from the subroutine .high1 LDA scoreLo \ (scoreHi scoreLo) > (highScoreHi highScoreLo), so this STA highScoreLo \ is a new high score, so update the 16-bit high score LDA scoreHi \ to the new score STA highScoreHi .high3 RTS \ Return from the subroutineName: UpdateHighScore [Show more] Type: Subroutine Category: Scoring Summary: If this is a high score, update the high scoreContext: See this subroutine in context in the source code References: This subroutine is called as follows: * TerminateGame calls UpdateHighScore
[X]
Label high1 is local to this routine
[X]
Label high3 is local to this routine
[X]
Variable highScoreHi (category: Scoring)
High score (low byte)
[X]
Variable highScoreLo (category: Scoring)
High score (high byte)
[X]
Variable scoreHi (category: Scoring)
Score (high byte)
[X]
Variable scoreLo (category: Scoring)
Score (low byte)