chti23/soft/PjtKEIL_StepSon/Src/GestionSon.s
2023-03-27 10:53:30 +02:00

67 lines
No EOL
1 KiB
ArmAsm

PRESERVE8
THUMB
; ====================== 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
Offset equ 32768
Intervalle equ 360
Index equ 0
EXPORT CallbackSon
; ===============================================================================================
;Section ROM code (read only) :
area moncode,code,readonly
; écrire le code ici
;short int SortieSon;
;int LongueurSon 5512
;int i;
;if not i == LongueurSon
;lire[i] str
;i++
;
;360*(SortieSon+32768)/32768
import son
import LongueurSon
CallbackSon proc
push {lr}
ldr r0,=son ; tableau de données
ldr r1,=SortieSon ; resultat
ldr r2,[r1,#LongueurSon] ; point fini
ldr r3,[r1,#Index] ; position actuelle
add r3,#1
cmp r2,r3 ;if on n'arrive pas la fin de tableau, on continue
beq FIN ; if oui on quitte le prog
; ldr r4,
; ldrsh []
FIN
mov r3,#0
ENDP
END