SHARE
TWEET

Untitled

a guest Apr 26th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .data
  2. a1: .word 0
  3. a2: .word 0
  4. a3: .word 0
  5. a4: .word 0
  6. a5: .word 0
  7. a: .word a1
  8. max: .word 0
  9. min: .word 0
  10. nmax: .asciiz "Maksymalna liczba = %d\n"
  11. nmin: .asciiz "Minimalna liczba = %d\n"
  12. .align 2
  13. adresmax: .word nmax
  14. valmax: .space 4
  15. adresmin: .word nmin
  16. valmin: .space 4
  17.  
  18. .text
  19. addi r10, r0, 49
  20. addi r20, r0, napis
  21. loop:
  22.     jal czytaj
  23.    
  24.     lw r2, a
  25.     sw (r2), r1
  26.     addi r2, r2, 4
  27.     sw a, r2
  28.    
  29.     addi r10, r10, 1
  30.     sb 9(r20), r10
  31.    
  32.     sgti r2, r10, 53
  33.     beqz r2, loop
  34.  
  35. addi r1, r0, a2
  36. sw a, r1
  37. lw r1, a1
  38. sw max, r1
  39. sw min, r1
  40. addi r10, r0, 1
  41.  
  42. loop2:
  43.     lw r1, a
  44.    
  45.     lw r3, max
  46.     lw r4, min
  47.     lw r2, (r1)
  48.     sgt r5, r2, r3
  49.     slt r6, r2, r4
  50.    
  51.     beqz r5, omijaj1
  52.         sw max, r2
  53.     omijaj1:
  54.     beqz r6, omijaj2
  55.         sw min, r2
  56.     omijaj2:
  57.    
  58.     addi r1, r1, 4
  59.     sw a, r1
  60.     addi r10, r10, 1
  61.     sgti r2, r10, 4
  62.     beqz r2, loop2
  63.  
  64. lw r1, max
  65. sw valmax, r1
  66. addi r14, r0, adresmax
  67. trap 5
  68. lw r1, min
  69. sw valmin, r1
  70. addi r14, r0, adresmin
  71. trap 5
  72.  
  73. trap 0
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