Advertisement
Garey

Exercise1_10

Apr 9th, 2020
4,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.32 KB | None | 0 0
  1. .global start
  2.  
  3. start:
  4.     MOV R0, #3
  5.     MOV R1, #6
  6.     LDRD R2, =array
  7.  
  8. check:
  9.     CMP R1, #1
  10.     BNE loop
  11.     B exit
  12.  
  13. loop:
  14.     LDRD R5, [R2], #4
  15.    
  16.     CMP R0, R5
  17.     SUBEQ R0, R0, #1
  18.  
  19.     SUB R1, R1, #1
  20.  
  21.     B check
  22.  
  23. exit:
  24.     MOV R7, #1
  25.     SWI 0
  26.    
  27. .data
  28.     array: .dword 1, 2, 3, 4, 5, 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement