PRESERVE8 THUMB IMPORT LongueurSon IMPORT PeriodeSonMicroSec IMPORT Son EXPORT CallbackSon ; ====================== zone de réservation de données, ====================================== ;Section RAM (read only) : area mesdata,data,readonly ;Section RAM (read write): area maram,data,readwrite SortieSon dcw 0 EXPORT SortieSon ; =============================================================================================== ;Section ROM code (read only) : area moncode,code,readonly ; écrire le code ici CallbackSon proc ;; 1. Il faut pouvoir utiliser SortieSon comme index d'iteration dans le tableau bruitverre push {r4,r5,r6,r7} ldr r7,=SortieSon ldr r1,=LongueurSon ldr r2,=Son mov r3,#0 mov r4,#719 lsr r4,r4,#1 calcul ldrsh r0, [r2,r3,lsl #1] ;cmp r0,#0x00007FFF ;bgt calcul_neg ;faire +32768, ensuite x719, puis diviser par 2^16 mov r5,#32767 udiv r6,r5,r4 mul r0,r6 add r0,r4 str r0,[r7] add r3,#1 cmp r1,r3 bne calcul bl fin calcul_neg mov r5,#32768 udiv r6,r4,r5 mul r0,r6 sub r0,r4 lsl r5,r0,#1 sub r0,r5 str r0,[r7] add r3,#1 cmp r1,r3 bne calcul fin pop {r4,r5,r6,r7} END