Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. section .init
  2. .global _start$
  3. _start$:
  4. ldr r0,=0x3F200000 @ store number 3F200000 in register r0
  5. mov r1,#1
  6. lsl r1,#21
  7. str r1,[r0,#4] @ make pin outputs
  8. mov r1,#1 @ move number dec 1 to Output pin 1
  9. lsl r1,#17 @ move value in r1 by 17 places to the left
  10. _loop$:
  11. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  12. mov r2,#0x8F0000 @ 0x8F0000 is some number we want to decrement to 0
  13. _wait1s$:
  14. sub r2,#1
  15. cmp r2,#0
  16. bne _wait1s$
  17. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  18. mov r2,#0x1F0000
  19. _wait2s$:
  20. sub r2,#1
  21. cmp r2,#0
  22. bne _wait2s$
  23. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  24. mov r2,#0x1F0000 @ 0x1F0000 is some number we want to decrement to 0
  25. _wait3s$:
  26. sub r2,#1
  27. cmp r2,#0
  28. bne _wait3s$
  29. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  30. mov r2,#0x1F0000
  31. _wait4s$:
  32. sub r2,#1
  33. cmp r2,#0
  34. bne _wait4s$
  35. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  36. mov r2,#0x1F0000
  37. _wait5s$:
  38. sub r2,#1
  39. cmp r2,#0
  40. bne _wait5s$
  41. Projektarbeit GTI 20.01.2018 Martina Schwab, Thomas Burri,
  42. Daniel Zimmermann
  43. str r1,[r0,#28]
  44. mov r2,#0x1F0000
  45. _wait6s$:
  46. sub r2,#1
  47. cmp r2,#0
  48. bne _wait6s$
  49. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  50. mov r2,#0x1F0000
  51. _wait7s$:
  52. sub r2,#1
  53. cmp r2,#0
  54. bne _wait7s$
  55. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  56. mov r2,#0x4F0000
  57. _wait1l$:
  58. sub r2,#1
  59. cmp r2,#0
  60. bne _wait1l$
  61. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  62. mov r2,#0x1F0000
  63. _wait2l$:
  64. sub r2,#1
  65. cmp r2,#0
  66. bne _wait2l$
  67. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  68. mov r2,#0x4F0000
  69. _wait3l$:
  70. sub r2,#1
  71. cmp r2,#0
  72. bne _wait3l$
  73. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  74. mov r2,#0x1F0000
  75. _wait4l$:
  76. sub r2,#1
  77. cmp r2,#0
  78. bne _wait4l$
  79. mov r2,#0
  80. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  81. mov r2,#0x4F0000
  82. _wait5l$:
  83. sub r2,#1
  84. cmp r2,#0
  85. bne _wait5l$
  86. mov r2,#0
  87. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  88. mov r2,#0x1F0000
  89. _wait6l$:
  90. sub r2,#1
  91. cmp r2,#0
  92. bne _wait6l$
  93. mov r2,#0
  94. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  95. mov r2,#0x1F0000
  96. _wait8s$:
  97. sub r2,#1
  98. cmp r2,#0
  99. bne _wait8s$
  100. mov r2,#0
  101. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  102. mov r2,#0x1F0000
  103. _wait9s$:
  104. sub r2,#1
  105. cmp r2,#0
  106. bne _wait9s$
  107. mov r2,#0
  108. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  109. mov r2,#0x1F0000
  110. _wait10s$:
  111. sub r2,#1
  112. cmp r2,#0
  113. bne _wait10s$
  114. mov r2,#0
  115. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  116. mov r2,#0x1F0000
  117. _wait11s$:
  118. sub r2,#1
  119. cmp r2,#0
  120. bne _wait11s$
  121. mov r2,#0
  122. str r1,[r0,#28] @ turn off GPIO 17 (turn on LED)
  123. mov r2,#0x1F0000
  124. _wait12s$:
  125. sub r2,#1
  126. cmp r2,#0
  127. bne _wait12s$
  128. mov r2,#0
  129. str r1,[r0,#40] @ turn on GPIO 17 (turn off LED)
  130. mov r2,#0x1F0000
  131. _wait13s$:
  132. sub r2,#1
  133. Projektarbeit GTI 20.01.2018 Martina Schwab, Thomas Burri,
  134. Daniel Zimmermann
  135. cmp r2,#0
  136. bne _wait13s$
  137. b _loop$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement