Debian Codegraph @

Source/DSPSpy/tests/rti_test.ds

raw
1 ; This test needs to manually specify IRQs
2 jmp irq0
3 jmp irq1
4 jmp irq2
5 jmp irq3
6 jmp irq4
7 jmp accov_irq
8 jmp irq6
9 jmp irq7
10
11 incdir "tests"
12 include "dsp_base_noirq.inc"
13
14 test_main:
15 ; Use the accelerator to generate an IRQ by setting the start and end address to 0
16 ; This will result in an interrupt on every read
17 SI @PRED_SCALE, #0
18 SI @YN1, #0
19 SI @YN2, #0
20 SI @FORMAT, #0
21 SI @ACSAH, #0
22 SI @ACCAH, #0
23 SI @ACSAL, #0
24 SI @ACCAL, #0
25 SI @ACEAH, #0
26 SI @ACEAL, #0
27
28
29 LRI $AX1.H, #0x0000
30 LRS $AX0.L, @ACDSAMP ; Trigger interrupt
31 CALL send_back
32
33 LRI $AX1.H, #0x0001
34 LRS $AX0.L, @ACDSAMP ; Trigger interrupt
35 CALL send_back
36
37 LRI $AX1.H, #0x0000
38 LRS $AX0.L, @ACDSAMP ; Trigger interrupt
39 CALL send_back
40
41 jmp end_of_test
42
43 accov_irq:
44 ; Restore registers, otherwise no new interrupt will be generated
45 SI @PRED_SCALE, #0
46 SI @YN1, #0
47 SI @YN2, #0
48
49 TSTAXH $AX1.H
50 LRI $AX1.L, #0x1111
51 cw 0x02f4 ; RTINZ if it exists
52 LRI $AX1.L, #0x2222
53 cw 0x02f5 ; RTIZ if it exists
54 LRI $AX1.L, #0x3333
55 RTI