No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

signal.s 831B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. thumb
  2. area mesdata, data, readwrite; déclaration d'une zone pour vriable
  3. FLAG DCD 0 ;initialisation d'une vaiable flag cf TD
  4. area moncode, code, readonly
  5. export timer_callback
  6. GPIOB_BSRR equ 0x40010C10 ; Bit Set/Reset register
  7. ;fonction principale
  8. timer_callback proc
  9. ; r0 = FLAG
  10. ; r1 = valeur du FLAG
  11. ; r2 = la valeur a 2
  12. ; r3 = adreess GRPIOB_BSRR
  13. ldr r0, =FLAG
  14. ldr r1, [r0]
  15. cbz r1, mise_a_1
  16. cbnz r1, mise_a_0
  17. endp
  18. ; mise a 1 de PB1
  19. mise_a_1
  20. ldr r3, =GPIOB_BSRR
  21. mov r2, #0x00000002
  22. str r2, [r3]
  23. ;Mise a 1 du flag
  24. mov r1, #0x1
  25. str r1,[r0]
  26. bx lr
  27. mise_a_0
  28. ; mise a zero de PB1
  29. ldr r3, =GPIOB_BSRR
  30. mov r2, #0x00020000
  31. str r2, [r3]
  32. ;Mise a 0 du flag
  33. mov r1, #0x0
  34. str r1,[r0]
  35. bx lr
  36. endp
  37. end
  38. ; N.B. le registre BSRR est write-only, on ne peut pas le relire