_stdbuf equ 1536
_putchr_proc_adr equ 1619
_std_print_out___5 equ _stdbuf
_std_print_out___6 equ _putchr_proc_adr
timer equ 20
count equ 128
   org $2e0
   dta a($2000)
   org $2000
;### count_2sec.atl(9) "Counting 2 seconds..."
   jsr _std_print_out
   dta b(21),c'Counting 2 seconds...'
   dta b(128)
   dta b(0)
;### count_2sec.atl(11) count = 0
   lda #0
   sta count-0+2
;### count_2sec.atl(12) timer = 0
   sta timer
   tax
   tay
;### count_2sec.atl(16) "Counted to [count]."
   jmp _lbl4
_lbl6:
;### count_2sec.atl(14)   inc count
   inx
   jne _lbl4
   iny
   jne _lbl4
   inc count+2
_lbl4:
;### count_2sec.atl(13) until timer = 100
   lda timer
   cmp #100
   jne _lbl6
_lbl5:
   sty count-0+1
   stx count-0
   jsr _std_print_out
   dta b(11),c'Counted to '
   dta b(131),a(count)
   dta b(1),c'.'
   dta b(128)
   dta b(0)
_lbl8:
   jmp _lbl8
   icl 'C:\nes\atalan\codebase\atalan\platform\atari\atari.asm'
   icl 'C:\nes\atalan\codebase\atalan\processor\m6502\m6502.asm'

