Advertisement
UrQuan

ADR Zadaca 2

May 13th, 2014
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 0.53 KB | None | 0 0
  1. .equ x, 10
  2. .equ y, 5
  3. .global _start
  4. .text
  5. _start:
  6.     MOV R0, #X
  7.     MOV R1, #Y
  8.    
  9.     CMP R0, #0
  10.     CMP R1, #0
  11.     BGT izraz
  12.    
  13.     LDR R2, =poruka
  14.     B stop
  15. izraz:
  16.     MUL R3, R0, R1
  17.     SUB R0, R3, #20
  18.     ADD R1, R1, #1
  19.     B stop
  20. poruka:
  21.     .asciz "Brojevi ne smiju biti negativni."
  22. stop:
  23.     B stop
  24. .end
  25.  
  26. /* ********** */
  27.  
  28. .equ a, 3
  29. .equ b, 10
  30. .global _start
  31. _start:
  32.     MOV R0, #a
  33.     MOV R1, #b
  34.     MOV R2, #0
  35.     MOV R3, #3
  36.    
  37.     CMP R2,#4
  38.     BGT stop
  39. next:
  40.     MUL R0, R3, R0
  41.     SUB R1, R1, #2
  42.     ADD R2. R2, #1
  43.     CMP R2, #4
  44.     BLT next
  45. stop:
  46.     B stop
  47. .end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement