forked from acco/chti23
210 lines
No EOL
5.8 KiB
ArmAsm
210 lines
No EOL
5.8 KiB
ArmAsm
PRESERVE8
|
|
THUMB
|
|
include Driver/DriverJeuLaser.inc
|
|
|
|
; ====================== zone de réservation de données, ======================================
|
|
;Section RAM (read only) :
|
|
area mesdata,data,readonly
|
|
|
|
|
|
;Section RAM (read write):
|
|
area maram,data,readwrite
|
|
|
|
|
|
|
|
; ===============================================================================================
|
|
EXPORT DFT_ModuleAuCarre
|
|
|
|
|
|
|
|
;Section ROM code (read only) :
|
|
area moncode,code,readonly
|
|
; écrire le code ici
|
|
|
|
DFT_ModuleAuCarre proc
|
|
push{lr, r4,r5, r6, r7, r8, r9, r10}
|
|
|
|
mov r2, r0 ; mettre l'adresse du signal dans r2
|
|
mov r0, #0 ; r0 peut être utilisé ;dans r1 on a la valeur de k
|
|
ldr r4,=TabCos
|
|
ldr r9,=TabSin
|
|
mov r5, #0 ; contient notre indice n
|
|
|
|
Boucle
|
|
cmp r5,#63
|
|
bgt Fin
|
|
ldrsh r3,[r2, r5, LSL #1] ; x[n] ; là format 4.12 (1.12)
|
|
mul r6, r1, r5 ; kn
|
|
and r6, r6, #63 ; kn & 000000000011111
|
|
ldrsh r7,[r4, r6, LSL #1] ; TabCos[kn] ; là format 1.15
|
|
mul r10, r3, r7 ; x[n]*TabCos[n] 5.27
|
|
asr r10, r10, #1 ; 5.26
|
|
;asr r0, r0, #1 ; 6.26
|
|
;mla r0, r7, r3, r0 ; x(k) += x[n]*TabCos[n] ;11.27
|
|
add r0, r0, r10 ; 6.24 ; r0 contient la valeur de la somme des Cos
|
|
|
|
ldrsh r7,[r9, r6, LSL #1] ; TabSin[kn] ; là format 1.15
|
|
mul r10, r3, r7 ; x[n]*TabSin[n] 5.27
|
|
asr r10, r10, #1 ; 5.26
|
|
;asr r8, r8, #4 ; 5.26
|
|
add r8, r8, r10 ; 6.26 ; r8 contient la valeur de la somme des Sin
|
|
|
|
add r5, #1
|
|
bl Boucle
|
|
|
|
Fin
|
|
|
|
asr r0, r0, #16 ; 6.10
|
|
asr r8, r8, #16 ; 6.10
|
|
mul r0, r0, r0 ; 12.20
|
|
mul r8, r8, r8 ; 12.20
|
|
asr r0, r0, #1 ; 12.19
|
|
asr r8, r8, #1 ; 12.19
|
|
|
|
add r0, r0, r8 ; 13.19
|
|
|
|
pop{pc, r4, r5, r6, r7, r8, r9, r10}
|
|
|
|
endp
|
|
|
|
|
|
|
|
;Section ROM code (read only) :
|
|
AREA Trigo, DATA, READONLY
|
|
; codage fractionnaire 1.15
|
|
|
|
TabCos
|
|
DCW 32767 ; 0 0x7fff 0.99997
|
|
DCW 32610 ; 1 0x7f62 0.99518
|
|
DCW 32138 ; 2 0x7d8a 0.98077
|
|
DCW 31357 ; 3 0x7a7d 0.95694
|
|
DCW 30274 ; 4 0x7642 0.92389
|
|
DCW 28899 ; 5 0x70e3 0.88193
|
|
DCW 27246 ; 6 0x6a6e 0.83148
|
|
DCW 25330 ; 7 0x62f2 0.77301
|
|
DCW 23170 ; 8 0x5a82 0.70709
|
|
DCW 20788 ; 9 0x5134 0.63440
|
|
DCW 18205 ; 10 0x471d 0.55557
|
|
DCW 15447 ; 11 0x3c57 0.47141
|
|
DCW 12540 ; 12 0x30fc 0.38269
|
|
DCW 9512 ; 13 0x2528 0.29028
|
|
DCW 6393 ; 14 0x18f9 0.19510
|
|
DCW 3212 ; 15 0x0c8c 0.09802
|
|
DCW 0 ; 16 0x0000 0.00000
|
|
DCW -3212 ; 17 0xf374 -0.09802
|
|
DCW -6393 ; 18 0xe707 -0.19510
|
|
DCW -9512 ; 19 0xdad8 -0.29028
|
|
DCW -12540 ; 20 0xcf04 -0.38269
|
|
DCW -15447 ; 21 0xc3a9 -0.47141
|
|
DCW -18205 ; 22 0xb8e3 -0.55557
|
|
DCW -20788 ; 23 0xaecc -0.63440
|
|
DCW -23170 ; 24 0xa57e -0.70709
|
|
DCW -25330 ; 25 0x9d0e -0.77301
|
|
DCW -27246 ; 26 0x9592 -0.83148
|
|
DCW -28899 ; 27 0x8f1d -0.88193
|
|
DCW -30274 ; 28 0x89be -0.92389
|
|
DCW -31357 ; 29 0x8583 -0.95694
|
|
DCW -32138 ; 30 0x8276 -0.98077
|
|
DCW -32610 ; 31 0x809e -0.99518
|
|
DCW -32768 ; 32 0x8000 -1.00000
|
|
DCW -32610 ; 33 0x809e -0.99518
|
|
DCW -32138 ; 34 0x8276 -0.98077
|
|
DCW -31357 ; 35 0x8583 -0.95694
|
|
DCW -30274 ; 36 0x89be -0.92389
|
|
DCW -28899 ; 37 0x8f1d -0.88193
|
|
DCW -27246 ; 38 0x9592 -0.83148
|
|
DCW -25330 ; 39 0x9d0e -0.77301
|
|
DCW -23170 ; 40 0xa57e -0.70709
|
|
DCW -20788 ; 41 0xaecc -0.63440
|
|
DCW -18205 ; 42 0xb8e3 -0.55557
|
|
DCW -15447 ; 43 0xc3a9 -0.47141
|
|
DCW -12540 ; 44 0xcf04 -0.38269
|
|
DCW -9512 ; 45 0xdad8 -0.29028
|
|
DCW -6393 ; 46 0xe707 -0.19510
|
|
DCW -3212 ; 47 0xf374 -0.09802
|
|
DCW 0 ; 48 0x0000 0.00000
|
|
DCW 3212 ; 49 0x0c8c 0.09802
|
|
DCW 6393 ; 50 0x18f9 0.19510
|
|
DCW 9512 ; 51 0x2528 0.29028
|
|
DCW 12540 ; 52 0x30fc 0.38269
|
|
DCW 15447 ; 53 0x3c57 0.47141
|
|
DCW 18205 ; 54 0x471d 0.55557
|
|
DCW 20788 ; 55 0x5134 0.63440
|
|
DCW 23170 ; 56 0x5a82 0.70709
|
|
DCW 25330 ; 57 0x62f2 0.77301
|
|
DCW 27246 ; 58 0x6a6e 0.83148
|
|
DCW 28899 ; 59 0x70e3 0.88193
|
|
DCW 30274 ; 60 0x7642 0.92389
|
|
DCW 31357 ; 61 0x7a7d 0.95694
|
|
DCW 32138 ; 62 0x7d8a 0.98077
|
|
DCW 32610 ; 63 0x7f62 0.99518
|
|
TabSin
|
|
DCW 0 ; 0 0x0000 0.00000
|
|
DCW 3212 ; 1 0x0c8c 0.09802
|
|
DCW 6393 ; 2 0x18f9 0.19510
|
|
DCW 9512 ; 3 0x2528 0.29028
|
|
DCW 12540 ; 4 0x30fc 0.38269
|
|
DCW 15447 ; 5 0x3c57 0.47141
|
|
DCW 18205 ; 6 0x471d 0.55557
|
|
DCW 20788 ; 7 0x5134 0.63440
|
|
DCW 23170 ; 8 0x5a82 0.70709
|
|
DCW 25330 ; 9 0x62f2 0.77301
|
|
DCW 27246 ; 10 0x6a6e 0.83148
|
|
DCW 28899 ; 11 0x70e3 0.88193
|
|
DCW 30274 ; 12 0x7642 0.92389
|
|
DCW 31357 ; 13 0x7a7d 0.95694
|
|
DCW 32138 ; 14 0x7d8a 0.98077
|
|
DCW 32610 ; 15 0x7f62 0.99518
|
|
DCW 32767 ; 16 0x7fff 0.99997
|
|
DCW 32610 ; 17 0x7f62 0.99518
|
|
DCW 32138 ; 18 0x7d8a 0.98077
|
|
DCW 31357 ; 19 0x7a7d 0.95694
|
|
DCW 30274 ; 20 0x7642 0.92389
|
|
DCW 28899 ; 21 0x70e3 0.88193
|
|
DCW 27246 ; 22 0x6a6e 0.83148
|
|
DCW 25330 ; 23 0x62f2 0.77301
|
|
DCW 23170 ; 24 0x5a82 0.70709
|
|
DCW 20788 ; 25 0x5134 0.63440
|
|
DCW 18205 ; 26 0x471d 0.55557
|
|
DCW 15447 ; 27 0x3c57 0.47141
|
|
DCW 12540 ; 28 0x30fc 0.38269
|
|
DCW 9512 ; 29 0x2528 0.29028
|
|
DCW 6393 ; 30 0x18f9 0.19510
|
|
DCW 3212 ; 31 0x0c8c 0.09802
|
|
DCW 0 ; 32 0x0000 0.00000
|
|
DCW -3212 ; 33 0xf374 -0.09802
|
|
DCW -6393 ; 34 0xe707 -0.19510
|
|
DCW -9512 ; 35 0xdad8 -0.29028
|
|
DCW -12540 ; 36 0xcf04 -0.38269
|
|
DCW -15447 ; 37 0xc3a9 -0.47141
|
|
DCW -18205 ; 38 0xb8e3 -0.55557
|
|
DCW -20788 ; 39 0xaecc -0.63440
|
|
DCW -23170 ; 40 0xa57e -0.70709
|
|
DCW -25330 ; 41 0x9d0e -0.77301
|
|
DCW -27246 ; 42 0x9592 -0.83148
|
|
DCW -28899 ; 43 0x8f1d -0.88193
|
|
DCW -30274 ; 44 0x89be -0.92389
|
|
DCW -31357 ; 45 0x8583 -0.95694
|
|
DCW -32138 ; 46 0x8276 -0.98077
|
|
DCW -32610 ; 47 0x809e -0.99518
|
|
DCW -32768 ; 48 0x8000 -1.00000
|
|
DCW -32610 ; 49 0x809e -0.99518
|
|
DCW -32138 ; 50 0x8276 -0.98077
|
|
DCW -31357 ; 51 0x8583 -0.95694
|
|
DCW -30274 ; 52 0x89be -0.92389
|
|
DCW -28899 ; 53 0x8f1d -0.88193
|
|
DCW -27246 ; 54 0x9592 -0.83148
|
|
DCW -25330 ; 55 0x9d0e -0.77301
|
|
DCW -23170 ; 56 0xa57e -0.70709
|
|
DCW -20788 ; 57 0xaecc -0.63440
|
|
DCW -18205 ; 58 0xb8e3 -0.55557
|
|
DCW -15447 ; 59 0xc3a9 -0.47141
|
|
DCW -12540 ; 60 0xcf04 -0.38269
|
|
DCW -9512 ; 61 0xdad8 -0.29028
|
|
DCW -6393 ; 62 0xe707 -0.19510
|
|
DCW -3212 ; 63 0xf374 -0.09802
|
|
|
|
|
|
|
|
|
|
END
|