summaryrefslogtreecommitdiff
path: root/Source/DSPSpy/tests/rti_test.ds
blob: 81acd6af472e1ee43a7c535125cc0f699d3759f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; This test needs to manually specify IRQs
	jmp		irq0
	jmp		irq1
	jmp		irq2
	jmp		irq3
	jmp		irq4
	jmp		accov_irq
	jmp		irq6
	jmp		irq7

incdir  "tests"
include "dsp_base_noirq.inc"

test_main:
	; Use the accelerator to generate an IRQ by setting the start and end address to 0
	; This will result in an interrupt on every read
	SI @0xffda, #0 ; pred_scale
	SI @0xffdb, #0 ; yn1
	SI @0xffdc, #0 ; yn2
	SI @0xffd1, #0 ; SampleFormat
	SI @ACSAH, #0
	SI @ACCAH, #0
	SI @ACSAL, #0
	SI @ACCAL, #0
	SI @ACEAH, #0
	SI @ACEAL, #0


	LRI $AX1.H, #0x0000
	LRS $AX0.L, @ARAM ; Trigger interrupt
	CALL send_back

	LRI $AX1.H, #0x0001
	LRS $AX0.L, @ARAM ; Trigger interrupt
	CALL send_back

	LRI $AX1.H, #0x0000
	LRS $AX0.L, @ARAM ; Trigger interrupt
	CALL send_back

	jmp end_of_test

accov_irq:
	; Restore registers, otherwise no new interrupt will be generated
	SI @0xffda, #0 ; pred_scale
	SI @0xffdb, #0 ; yn1
	SI @0xffdc, #0 ; yn2

	TSTAXH $AX1.H
	LRI $AX1.L, #0x1111
	cw 0x02f4              ; RTINZ if it exists
	LRI $AX1.L, #0x2222
	cw 0x02f5              ; RTIZ if it exists
	LRI $AX1.L, #0x3333
	RTI