LegoDrifter

MIPS PREMIUM PROGRAMA SO SCANF DALI SE EDNAKVI!!!

Apr 18th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. .data
  2. message: .asciiz "Broevite se ednakvi!"
  3. message2: .asciiz "Ne se ednakvi"
  4. broj1: .asciiz "Vnesi go prviot broj: "
  5. broj2: .asciiz "Vnesi go vtoriot broj: "
  6. .text
  7. main:
  8. li $v0, 4
  9. la $a0, broj1
  10. syscall
  11.  
  12. li $v0, 5 # scanf za integer / broj 1
  13. syscall
  14. move $t0, $v0
  15.  
  16. li $v0, 4
  17. la $a0, broj2
  18. syscall
  19.  
  20. li $v0, 5 #scanf za intenger / broj 2
  21. syscall
  22. move $t1, $v0
  23.  
  24.  
  25.  
  26. beq $t0,$t1 label1 #AKO VAZIT USLOVOV SKOKAS VO LABEL1, AKO NE SE IZVRSUVAT TO DOLU
  27.  
  28. li $v0, 4
  29. la $a0, message2
  30. syscall
  31. j end # TREBIT DA GO KORISTIME J END BIDEJKO AKO NEMAME CE GO CITAT I LABEL1 I CE NI ISPRINTAT DVE PORAKI
  32.  
  33.  
  34. label1:
  35. li $v0, 4
  36. la $a0, message
  37. syscall
  38. j end
  39.  
  40. end:
  41. #Syscall to end a program
  42. li $v0, 10
  43. syscall
Add Comment
Please, Sign In to add comment