Skip to content

Instantly share code, notes, and snippets.

@spacekitcat
Last active August 10, 2019 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacekitcat/765757ad4341e1c96f5562cd9829136c to your computer and use it in GitHub Desktop.
Save spacekitcat/765757ad4341e1c96f5562cd9829136c to your computer and use it in GitHub Desktop.
Code demonstrating a 16-bit counter written for the 6502, an 8-bit processor
lda #$00
sta $a0
lda #$00
sta $a1
LSB_INC:
ldy $a0 ; Debug, shows the LSB in the Y register
inc $a0
BNE LSB_INC
LSB_RESET:
ldx $a1 ; Debug, shows the MSB in the X register
lda #$00
sta $a0
MSB_INC:
inc $a1
BNE LSB_INC
EXIT:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment