Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ex42.s:
  2.  
  3. .text
  4. .globl __start
  5. __start: # execution starts here
  6. la $a0,prompt
  7. li $v0,4
  8. syscall # display prompt
  9. li $v0,5
  10. syscall # read first integer in $v0
  11. move $t1,$v0 # and then move in $t1
  12. la $a0,prompt
  13. li $v0,4
  14. syscall # display prompt
  15. li $v0,5
  16. syscall # read second integer in $v0
  17. move $t2,$v0 # and then move in $t2
  18. blt $t1,100,cond1
  19. j end
  20. cond1: blt $t2,100,cond2
  21. j end
  22. cond2: la $a0,msg # display message
  23. li $v0,4
  24. syscall
  25. end:
  26. li $v0,10 # exit
  27. syscall
  28. .data
  29. prompt: .asciiz "Give integer: "
  30. msg: .asciiz "Both integers less than 100"
  31.  
  32. ex49.s:
  33.  
  34. .text
  35. .globl __start
  36. __start: # execution starts here
  37. la $a0,input # address of word to transform
  38. lw $t1,0($a0) # load word to $t1
  39. li $t0,0x001FF800 # mask definition
  40. and $t2,$t1,$t0 # masked word
  41. li $v0,10
  42. syscall
  43. .data
  44. input: .word 0xFFFFFFFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement