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.
 
 
 
 
 
 

61 lines
1.9 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2013 by Henrik Nilsson *
  3. * henrik.nilsson@bytequest.se *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
  19. ***************************************************************************/
  20. .text
  21. .syntax unified
  22. .arch armv7-m
  23. .thumb
  24. .thumb_func
  25. .align 4
  26. /* Inputs:
  27. * r0 buffer address
  28. * r1 NAND data address (byte wide)
  29. * r2 buffer length
  30. */
  31. read:
  32. ldrb r3, [r1]
  33. strb r3, [r0], #1
  34. subs r2, r2, #1
  35. bne read
  36. done_read:
  37. bkpt #0
  38. .align 4
  39. /* Inputs:
  40. * r0 NAND data address (byte wide)
  41. * r1 buffer address
  42. * r2 buffer length
  43. */
  44. write:
  45. ldrb r3, [r1], #1
  46. strb r3, [r0]
  47. subs r2, r2, #1
  48. bne write
  49. done_write:
  50. bkpt #0
  51. .end