;
; Micro-KIM demos
; (C) 2016 by Aart Bik
;
; For use with cross-assembler
; win2c64 (Windows), lin2c64 (linux),
; or mac2c64 (MacOS)
;
; http://www.aartbik.com/
;
; A simple three byte counter.
;

scands .equ $1f1f

;
; Start program at free RAM.
;
.org $0200

;
; Initialize 3 byte counter to zero.
;
     lda #0
     sta $f9
     sta $fa
     sta $fb

;
; Display and increment 3 byte counter in a loop.
; Displaying before each increment slows down
; the counting quite a bit.
;
loop jsr scands
     inc $f9
     bne loop
     inc $fa
     bne loop
     inc $fb
     jmp loop
