kontst equ $8
prosrg equ $9
primrg equ $b
konst  equ $150
eoci_f equ %00001000
ocf_f  equ %01000000
n      equ $20

       org $fffe
       fdb start
       org $2000
Proces rmb 2
       org $fff4
       fdb tim_prek
       org $a000
start  lds #$3000
       cli
       ldaa #eoci_f
       staa kontst
       ldd prosrg
       addd #konst
       std primrg

       wai

tim_prek ldaa kontst
         bita #ocf_f
         beq motnja

         ldd primrg
         addd #konst
         std primrg
         inc Proces
         ldaa Proces
         cmpa #n
         beq zacetek
motnja   rti
zacetek  clr Proces
         rti
