Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.55 KB | None | 0 0
  1. .syntax unified
  2. .global main
  3. .type main, %function
  4.  
  5. main:
  6.   bl init
  7.   mov r5, 109 @ tick counter
  8.   mov r0, 0xb1e0 @-22000
  9.   mov r6, r0
  10.  
  11. loop:
  12.   @1. Calculate the next value in the sawtooth signal
  13.   cmp r5, 0
  14.   beq reset
  15.  
  16.  
  17.   add r6, 0x193
  18.   mov r0, r6
  19.  
  20.  
  21.   @2. bl to BSP_AUDIO_OUT_Play_Sample with that value in r0
  22.   sub r5, 1
  23.   bl BSP_AUDIO_OUT_Play_Sample
  24.   b loop
  25.  
  26.   reset:
  27.     mov r5, 109
  28.     mov r0, 0xb1e0
  29.     mov r6, r0
  30.   @3. go back to the top of the loop to do it again for the next value
  31.   b loop
  32.  
  33.   .size main, .-main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement