SHARE
TWEET

Untitled

a guest Feb 18th, 2017 212 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .begin
  2. .org 2048
  3.  
  4. ld [address], %r1
  5. add %r0, 16, %r2 ! 20 bytes => 5 palabras, último valor en [address] + 16
  6.  
  7. ld [address_2], %r3
  8. add %r0, 0, %r4
  9. loop:   andcc %r2, %r2, %r0
  10.     bneg done
  11.     ld %r1, %r2, %r5 ! r5 = dato del array 1
  12.     st %r5, %r3, %r4
  13.     add %r2, -4, %r2 ! actualizo indices de arrays
  14.     add %r4, 4, %r4
  15.     ba loop
  16.  
  17. done: jmpl %r15 +4, %r0
  18.  
  19. address:    3000
  20. address_2:  3020
  21.  
  22. .org 3000
  23.     1
  24.     2
  25.     3
  26.     4
  27.     5
  28. .end
  29.  
  30. ---- Segunda versión con .dwb para el array a ser escrito ----
  31.  
  32. .begin
  33. .org 2048
  34.  
  35. ld [address_1], %r1
  36. add %r0, 16, %r2 ! 20 bytes => 5 palabras, último valor en [address] + 16
  37.  
  38. add %r0, 0, %r4
  39. loop:   andcc %r2, %r2, %r0
  40.     bneg done
  41.     ld %r1, %r2, %r5 ! r5 = dato del array 1
  42.     st %r5, %r4, [array_2]
  43.     add %r2, -4, %r2 ! actualizo indices de arrays
  44.     add %r4, 4, %r4
  45.     ba loop
  46.  
  47. done: jmpl %r15 +4, %r0
  48.  
  49. address: 3000
  50. .org 3000
  51. array_1:        1
  52.             2
  53.             3
  54.             4
  55.             5
  56.  
  57. array_2: .dwb 5
  58. .end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top