-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvFIR.s
60 lines (50 loc) · 996 Bytes
/
vFIR.s
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
56
57
58
59
60
.global _vFIR
_vFIR:
push w4
push w5
push w8
push w10
push w15
;Save old circular buffer
push MODCON
push XMODSRT
push XMODEND
push YMODSRT
push YMODEND
push CORCON
;Fractional signed
mov #0x00D1, w10
mov w10, CORCON
;Activate the circular buffer on w8
mov #0x8F08,w10
mov w10,MODCON
mov w0, XMODSRT
;(2 * FFT_BLOCK_LENGTH) - 1
add #127, w0
mov w0, XMODEND
nop
;Correct starting address for respective sample number and insert the latest
mov XMODSRT, w8
;w2 is counts of 16 bit width, w8 is counts of 8 bit width, so we add w2 twice to w8 (multiply by two and add to w8)
;add w2, w8, w8
;add w2, w8, w8
mov w1, w10
clr A, [w8]+=2, w4, [w10]+=2, w5
;FFT_BLOCK_LENGTH - 1
repeat #63
mac w4*w5, A, [w8]+=2, w4, [w10]+=2, w5
;-4+LOG2_BLOCK_LEGNTH
sac A, #2, w0
pop CORCON
pop YMODEND
pop YMODSRT
pop XMODEND
pop XMODSRT
pop MODCON
pop w15
pop w10
pop w8
pop w5
pop w4
return
.end