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.

stm32lx.S 2.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /***************************************************************************
  2. * Copyright (C) 2010 by Spencer Oliver *
  3. * spen@spen-soft.co.uk *
  4. * *
  5. * Copyright (C) 2011 Øyvind Harboe *
  6. * oyvind.harboe@zylin.com *
  7. * *
  8. * Copyright (C) 2011 Clement Burin des Roziers *
  9. * clement.burin-des-roziers@hikob.com *
  10. * *
  11. * This program is free software; you can redistribute it and/or modify *
  12. * it under the terms of the GNU General Public License as published by *
  13. * the Free Software Foundation; either version 2 of the License, or *
  14. * (at your option) any later version. *
  15. * *
  16. * This program is distributed in the hope that it will be useful, *
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  19. * GNU General Public License for more details. *
  20. * *
  21. * You should have received a copy of the GNU General Public License *
  22. * along with this program; if not, write to the *
  23. * Free Software Foundation, Inc., *
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
  25. ***************************************************************************/
  26. // Build : arm-eabi-gcc -c stm32lx.S
  27. .text
  28. .syntax unified
  29. .cpu cortex-m3
  30. .thumb
  31. .thumb_func
  32. .global write
  33. /*
  34. r0 - destination address
  35. r1 - source address
  36. r2 - count
  37. */
  38. // Set 0 to r3
  39. movs r3, #0
  40. // Go to compare
  41. b.n test_done
  42. write_word:
  43. // Load one word from address in r0, increment by 4
  44. ldr.w ip, [r1], #4
  45. // Store the word to address in r1, increment by 4
  46. str.w ip, [r0], #4
  47. // Increment r3
  48. adds r3, #1
  49. test_done:
  50. // Compare r3 and r2
  51. cmp r3, r2
  52. // Loop if not zero
  53. bcc.n write_word
  54. // Set breakpoint to exit
  55. bkpt #0x00