Advertisement
Guest User

Untitled

a guest
Oct 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.90 KB | None | 0 0
  1. .data
  2.  
  3. dividendo : .word 4     //r1
  4. divisor : .word 1       //r2
  5. cociente : .word 0x1234 //r3
  6. resto : .word 0x1235    //r4
  7. cero : .word 0          //r5
  8.  
  9. .text
  10.  
  11.  
  12. .global main
  13.  
  14. main:
  15.         ldr r1,=dividendo
  16.         ldr r1,[r1]
  17.         ldr r2,=divisor
  18.         ldr r2,[r2]
  19.         ldr r5,=cero
  20.         ldr r5,[r5]
  21.         mv r4,r1
  22.         bucle: cmp r2,r4
  23.                bge final
  24.                sub r4,r2
  25.                add r3,#1
  26.  
  27.                cmp r4,r5
  28.                beq si
  29.                 si:
  30.                 add r2,#1
  31.                 mov r4,#0
  32.                 mov r4,r1      
  33.                 b final_if
  34.                 final_if
  35.  
  36.                cmp r4,r2
  37.                 blt si
  38.                 si:
  39.                 add r2,#1
  40.                 mov r4,#0
  41.                 mov r4,r1
  42.                 b final_if2
  43.                 final_if2
  44.                      
  45.                 final:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement