215/317
7 - Debugger and PROM Programmer Tutorial for ST72251
ld A, #t_timer
; Initialize TAOCR1 register
ld taoc1hr, A
; (comparison register)
clr taoc1lr
inc A
; A counter reset will happen
ld taoc2hr, A
; before it reaches the value
; in TAOCR2
rim
; Enable maskable interrupts
; Main
; ====
Main:
call StartTasks
; Start kernel
; Though it is a call, it will never return
; Timer A interrupt (every 10ms)
; ==================================
intTim_A:
dec reg1
; Update timing registers
dec reg2
dec reg3
dec reg4
clr taclr
; Reset free running counter
tnz tasr
clr taoc1lr
; Clear OCF1
iret
; Code of task 1
; =================
Task1:
TASK 1
; Code of task 2
; =================
Task2:
TASK 2
; Code of task 3
; =================
Task3:
TASK 3
; Code of task 4
; =================
Task4:
TASK 4
; Vecteurs d'interruption
; =======================
segment 'vectit'
; ($FFE0)
DC.W
0
; skip unused vectors
DC.W
0
DC.W
0
DC.W
0
DC.W
0
DC.W
0
DC.W
0
DC.W
0
DC.W
0
tim_A: