Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main:
- bl init_audio
- movs r0, #0
- movs r4, #0 @counter register
- movw r5, #0x2001 @starting amplitude
- set_reset_acc:
- mov r4, r5 @resets r4
- acc: @accumulates the aplitude
- movs r0, r4 @store r0 to the value stored in r4
- adds r4, #25 @count up by 25
- bl play_audio_sample @play audio
- cmp r4, r5 @check if r4 is equal to r5 (overflows)
- beq set_reset_acc @if r4 is equal to r5 then reset r4
- b acc @if r4 is not equal to r5 then branch back to acc
- loop:
- b loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement