Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. main:
  2. bl init_audio
  3. movs r0, #0
  4. movs r4, #0 @counter register
  5. movw r5, #0x2001 @starting amplitude
  6.  
  7. set_reset_acc:
  8. mov r4, r5 @resets r4
  9.  
  10.  
  11. acc: @accumulates the aplitude
  12. movs r0, r4 @store r0 to the value stored in r4
  13. adds r4, #25 @count up by 25
  14. bl play_audio_sample @play audio
  15. cmp r4, r5 @check if r4 is equal to r5 (overflows)
  16. beq set_reset_acc @if r4 is equal to r5 then reset r4
  17. b acc @if r4 is not equal to r5 then branch back to acc
  18.  
  19. loop:
  20. b loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement